diff --git a/host_vars/unifi.yml b/host_vars/unifi.yml new file mode 100644 index 0000000..f235aad --- /dev/null +++ b/host_vars/unifi.yml @@ -0,0 +1,4 @@ +ansible_host: 5.9.220.118 +ansible_port: 22 +ansible_ssh_user: root +ansible_python_interpreter: /usr/bin/python3 \ No newline at end of file diff --git a/hosts.yml b/hosts.yml index bb5c588..0f83f4a 100644 --- a/hosts.yml +++ b/hosts.yml @@ -18,6 +18,11 @@ all: freifunk-supernodes: hosts: vpn02: + service_server: + children: + unifi: + hosts: + unifi: edge_router: hosts: edge1: diff --git a/roles/21-install-oitc/tasks/main.yml b/roles/21-install-oitc/tasks/main.yml index eb5eee3..ba3dcde 100644 --- a/roles/21-install-oitc/tasks/main.yml +++ b/roles/21-install-oitc/tasks/main.yml @@ -1,12 +1,13 @@ -- name: Repo Key Import - ansible.builtin.shell: curl https://packages.openitcockpit.io/repokey.txt | sudo apt-key add +- name: Add OITC GPG Key + ansible.builtin.get_url: + url: https://packages.openitcockpit.io/repokey.txt + dest: /etc/apt/keyrings/openitcockpit-agent-keyring.asc - name: Add specified repository into sources list ansible.builtin.apt_repository: - repo: deb https://packages.openitcockpit.io/openitcockpit-agent/deb/stable deb main + repo: "deb [signed-by=/etc/apt/keyrings/openitcockpit-agent-keyring.asc] https://packages.openitcockpit.io/openitcockpit-agent/deb/stable deb main" state: present - - name: Install OITC-Agent apt: name={{ item }} state=latest update_cache=yes with_items: diff --git a/roles/21-unifi/tasks/main.yml b/roles/21-unifi/tasks/main.yml new file mode 100644 index 0000000..8950b1b --- /dev/null +++ b/roles/21-unifi/tasks/main.yml @@ -0,0 +1,37 @@ +--- +- name: Install Packages for Unifi APT + ansible.builtin.apt: + name: + - ca-certificates + - apt-transport-https + state: latest + update_cache: yes + +- name: Add MongoDB GPG Key + ansible.builtin.get_url: + url: https://www.mongodb.org/static/pgp/server-3.0.asc + dest: /etc/apt/keyrings/mongodb-3.0.asc + +- name: Add Unifi GPG Key + ansible.builtin.get_url: + url: https://dl.ui.com/unifi/unifi-repo.gpg + dest: /etc/apt/trusted.gpg.d/unifi-repo.gpg + +- name: Add MongoDB repository into sources list using specified filename + ansible.builtin.apt_repository: + repo: "deb [trusted=yes] http://repo.mongodb.org/apt/ubuntu precise/mongodb-org/3.0 multiverse" + state: present + filename: mongodb + +- name: Add Unifi repository into sources list using specified filename + ansible.builtin.apt_repository: + repo: deb https://www.ui.com/downloads/unifi/debian stable ubiquiti + state: present + filename: unifi + +- name: Install Unifi via APT + ansible.builtin.apt: + name: + - unifi + state: latest + update_cache: yes \ No newline at end of file diff --git a/system-setup-unifi.yml b/system-setup-unifi.yml new file mode 100644 index 0000000..e3007f2 --- /dev/null +++ b/system-setup-unifi.yml @@ -0,0 +1,11 @@ +# ansible-playbook -i hosts.yml system-setup-unifi.yml +- name: System preperation + hosts: service_server + roles: + #- 00-ubuntu-basic + - 21-install-oitc + +- name: Unifi Setup + hosts: unifi + roles: + - 21-unifi \ No newline at end of file