Skip to content

Commit

Permalink
ansible playbook
Browse files Browse the repository at this point in the history
  • Loading branch information
sudermanjr committed Feb 26, 2023
1 parent 0772927 commit 152c5cc
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 0 deletions.
7 changes: 7 additions & 0 deletions hack/ansible/inventory.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
ledcontrollers:
hosts:
led_controller-2:
ansible_host: led-controller-2.suderman.us.com
led_count: 7
screen: false

8 changes: 8 additions & 0 deletions hack/ansible/led-controller.service.jinja
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[Unit]
Description=led-controller

[Service]
ExecStart=/usr/bin/led-controller --led-count {{ led_count }} dashboard -v=debug

[Install]
WantedBy=multi-user.target
43 changes: 43 additions & 0 deletions hack/ansible/playbook.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
- name: Install Controller
hosts: ledcontrollers
tasks:
- name: Ping
ansible.builtin.ping:
- name: Update repositories cache and install some packages
become: true
apt:
pkg:
- curl
- git
- realvnc-vnc-server
update_cache: yes
- name: dist-upgrade
become: true
apt:
upgrade: dist
- name: Remove useless packages from the cache
become: true
apt:
autoclean: yes
- name: Download led-controller binary
become: true
ansible.builtin.get_url:
url: https://github.com/sudermanjr/led-controller/releases/download/v0.3.0/led-controller
dest: /usr/bin/led-controller
- name: Setup a systemd service for the led-controller
become: true
ansible.builtin.template:
src: ./led-controller.service.jinja
dest: /etc/systemd/system/led-controller.service
owner: root
group: root
mode: '0755'
- name: systemctl daemon-reload
become: true
ansible.builtin.systemd:
daemon_reload: true
- name: systemctl start led-controller
become: true
ansible.builtin.systemd:
name: led-controller
state: started

0 comments on commit 152c5cc

Please sign in to comment.