From 4cde35f362a8e53e600a275ea9d8afda3a3aeaec Mon Sep 17 00:00:00 2001 From: Erin Moon Date: Sun, 16 Jun 2019 17:27:18 -0500 Subject: [PATCH] unifi! --- bootstrap.retry | 1 - roles/rpi-base/tasks/user.yml | 10 +++++----- roles/unifi/defaults/default.yml | 1 - roles/unifi/defaults/main.yml | 1 + roles/unifi/handlers/main.yml | 5 +++++ roles/unifi/tasks/main.yml | 27 ++++++++++++++++++++++++--- 6 files changed, 35 insertions(+), 10 deletions(-) delete mode 100644 bootstrap.retry delete mode 100644 roles/unifi/defaults/default.yml create mode 100644 roles/unifi/defaults/main.yml create mode 100644 roles/unifi/handlers/main.yml diff --git a/bootstrap.retry b/bootstrap.retry deleted file mode 100644 index 83215b3..0000000 --- a/bootstrap.retry +++ /dev/null @@ -1 +0,0 @@ -aux.local diff --git a/roles/rpi-base/tasks/user.yml b/roles/rpi-base/tasks/user.yml index c0ece72..c72dd16 100644 --- a/roles/rpi-base/tasks/user.yml +++ b/roles/rpi-base/tasks/user.yml @@ -1,8 +1,8 @@ -# - name: USER | change password -# user: -# name: pi -# password: "{{ lookup('passwordstore', 'infra/machine/pi@' + ansible_hostname + ' create=true length=20') -# | password_hash('sha512', 65534 | random(seed=inventory_hostname) | string) }}" +- name: USER | change password + user: + name: pi + password: "{{ lookup('passwordstore', 'infra/machine/pi@' + ansible_hostname + ' create=true length=20') + | password_hash('sha512', 65534 | random(seed=inventory_hostname) | string) }}" - name: USER | add authorized SSH key(s) authorized_key: diff --git a/roles/unifi/defaults/default.yml b/roles/unifi/defaults/default.yml deleted file mode 100644 index 48dd338..0000000 --- a/roles/unifi/defaults/default.yml +++ /dev/null @@ -1 +0,0 @@ -unifi_channel=stable diff --git a/roles/unifi/defaults/main.yml b/roles/unifi/defaults/main.yml new file mode 100644 index 0000000..ae0291e --- /dev/null +++ b/roles/unifi/defaults/main.yml @@ -0,0 +1 @@ +unifi_channel: stable diff --git a/roles/unifi/handlers/main.yml b/roles/unifi/handlers/main.yml new file mode 100644 index 0000000..1c0e637 --- /dev/null +++ b/roles/unifi/handlers/main.yml @@ -0,0 +1,5 @@ +- name: restart unifi + service: + name: unifi + state: restarted + become: yes diff --git a/roles/unifi/tasks/main.yml b/roles/unifi/tasks/main.yml index 6a50648..f9356fc 100644 --- a/roles/unifi/tasks/main.yml +++ b/roles/unifi/tasks/main.yml @@ -1,7 +1,28 @@ +- apt_key: + url: https://dl.ubnt.com/unifi/unifi-repo.gpg + state: present + become: yes + - apt_repository: repo: "deb http://www.ubnt.com/downloads/unifi/debian {{unifi_channel}} ubiquiti" state: present + become: yes -- apt_key: - url: https://dl.ubnt.com/unifi/unifi-repo.gpg - state: present \ No newline at end of file +- name: install java packages + apt: + name: openjdk-8-jre-headless + state: present + update_cache: yes + become: yes + + +- name: install unifi-controller packages + apt: + name: unifi + state: present + become: yes + notify: + - restart unifi + +# - name: disable default unifi mongodb +# lineinfile: \ No newline at end of file