Quickstart

This guide should serve to get you up and running with a simple setup.

Prerequisites

You will need:

  1. Somewhere to run Ansible (if you have the ability, I suggest a virtual machine so you can just ssh in and manage it from anywhere).

  2. Some other way to set the system’s timezone. Most linux distros should be fine if you set this at install time, but Ubuntu Server Minimal will reset the timezone every time tzdata is updated. This role used to try to set the timezone, but it was a pitiful game of whack-a-mole and was removed.

  3. At least one computer to be used as a signage player.

    • I recommend Ubuntu Server as the operating system on the player. That is the only Linux distribution I’ve tested. Theoretically, anything based on .deb and systemd should work, but I haven’t tried it.

Prepare the signage player

This is fairly standard Ansible setup.

  1. Install Ubuntu Server (make sure to enable the OpenSSH server!)

  2. Set your administrative user up for SSH key authentication
    1. On your computer where you run Ansible, run ssh-keygen to create an SSH key.

    2. Use ssh-copy-id <your-admin-username>@<your-signage-player-address> to automatically copy your new SSH key to the signage player.

    3. Try signing in using ssh <your-admin-username>@<your-signage-player-address>. If it doesn’t ask for a password, you’re done!

    Warning

    This is a very simple overview of the process. If you’re not familiar with key-based SSH authentication, it would be a good idea to read this guide: https://linuxhandbook.com/add-ssh-public-key-to-server/

  3. Set your administrative user up for passwordless sudo
    1. Create a file /etc/sudoers.d/<your-admin-username> with these contents:

      <your-admin-username> ALL=(ALL:ALL) NOPASSWD:ALL
      

    Tip

    Use visudo -f /etc/sudoers.d/<your-admin-username> to create this file. This will catch your mistakes and keep you from locking yourself out of your system. You will also need to install a text editor. I’m partial to nano, myself.

Install the Ansible role

This role is not (yet) published on ansible-galaxy. Currently, I have deployed it by cloning the git repository and creating my own hosts.yml and playbook.yml files. Add those to .gitignore, and then updating the role is as easy as git pull.

  1. Create a directory for your Ansible configuration and cd into it

    Tip

    You should place this directory under version control :)

  2. Create a roles directory and cd into that as well

  3. Clone the repository:

    git clone https://github.com/sheepman4267/ansible_role_signage_player.git
    

Configure Ansible

  1. cd back to your Ansible configuration directory

  2. You will need a playbook.yml:

    - hosts: signage_players
      roles:
      - role: 'signage_player'
    
  3. And a hosts.yml:

    its_sign_test:
    vars:
        ansible_user: administrator
        signage_schedule:
        - { days: "Mon,Tue,Wed,Thu,Fri,Sat,Sun", start_time: "08:00", end_time: "17:00", url: "https://example.com" }
    hosts:
        change-me-to-your-signage-player-address
    
  4. At this point, your directory structure should look like this:

    whatever-you-called-your-ansible-directory
    |-> roles/
    | |-> ansible_role_signage_player
    |-> playbook.yml
    |-> hosts.yml
    
  5. Change “ansible_user” to the administrative username you chose when setting up your operating system

  6. Configure signage_schedule to display a page of your choice (example.com is traditional)

    Tip

    The example schedule will display whatever you set “url” to from 8:00 AM to 5:00 PM, every day of the week. For more information on configuring the schedule, see signage_schedule.

  7. Add your signage player’s hostname or IP address to the “hosts” list

  8. Copy playbook.yml.example to playbook.yml

    Tip

    Unless you changed the ansible group name (default: signage_players) in hosts.yml, the example playbook should “just work” without editing anything.

  9. Run the playbook:

    ansible-playbook -i hosts.yml playbook.yml
    

Wait a few minutes. The signage player should eventually display xeyes, then chrome, dismiss the chrome first-run popup, and then display whatever you set in the schedule. Once you have that much working, go ahead to Advanced Configuration.