diff --git a/README.md b/README.md index 14c1209..bd0ac85 100644 --- a/README.md +++ b/README.md @@ -24,6 +24,6 @@ Ansible configuration repository for my homelab. `static_ip` host var set to the desired static IP address 8. Comment out `ansible_ssh_user` in `group_vars/all/vars.yml`, as this overwrites the one set in the hosts file -9. Run `ansible-playbook -i inventory/initial_hosts.ini first_run.yml`. This command will +9. Run `ansible-playbook -i initial-hosts.ini first_run.yml`. This command will hang at the `restart networking` step; at this point you can Ctrl-C. diff --git a/ansible.cfg b/ansible.cfg index 28cb5ff..387d99f 100644 --- a/ansible.cfg +++ b/ansible.cfg @@ -1,4 +1,4 @@ [defaults] vault_password_file = .ansible-password -inventory = inventory/local.ini +inventory = hosts.ini roles_path = roles diff --git a/inventory/initial_hosts.ini b/initial-hosts.ini similarity index 100% rename from inventory/initial_hosts.ini rename to initial-hosts.ini diff --git a/plays/nas.yml b/plays/nas.yml index 468ac7a..549a52c 100644 --- a/plays/nas.yml +++ b/plays/nas.yml @@ -70,12 +70,12 @@ - restic-rest tags: restic-rest -# - name: Install Lander -# hosts: nas -# become: yes -# roles: -# - lander -# tags: lander +- name: Install Lander + hosts: nas + become: yes + roles: + - lander + tags: lander - hosts: nas become: yes diff --git a/plays/web.yml b/plays/web.yml index 878a01a..da6bc2c 100644 --- a/plays/web.yml +++ b/plays/web.yml @@ -1,9 +1,9 @@ -# - hosts: web -# become: yes -# roles: -# - lander-web -# tags: lander +- hosts: web + become: yes + roles: + - lander-web + tags: lander - hosts: web become: yes @@ -83,8 +83,8 @@ - webdav-web tags: webdav -- hosts: web - become: yes - roles: - - otter-web - tags: otter +# - hosts: web +# become: yes +# roles: +# - otter-web +# tags: otter diff --git a/roles/base/tasks/main.yml b/roles/base/tasks/main.yml index fd487b4..8ec3e10 100644 --- a/roles/base/tasks/main.yml +++ b/roles/base/tasks/main.yml @@ -18,7 +18,7 @@ append: true create_home: yes shell: /bin/bash - password: "{{ debian_pass | password_hash('sha512') }}" + password: "{{ vault_debian_pass | password_hash('sha512') }}" update_password: on_create - name: Create SSH directory. diff --git a/roles/otter/files/otter.service b/roles/otter/files/otter.service index 97e93dc..e9e43fb 100644 --- a/roles/otter/files/otter.service +++ b/roles/otter/files/otter.service @@ -1,13 +1,13 @@ [Unit] Description=Gpodder.net API implementation -After=network.target network-online.target +After=docker.service +Requires=docker.service [Service] Type=exec -User=otter -Group=otter -ExecStart=/usr/local/bin/otter serve -c /etc/otter/otter.toml -Restart=always +WorkingDirectory=/etc/otter +ExecStart=/usr/bin/docker compose up +ExecStop=/usr/bin/docker compose down [Install] WantedBy=multi-user.target diff --git a/roles/otter/files/otter.toml b/roles/otter/files/otter.toml deleted file mode 100644 index de90880..0000000 --- a/roles/otter/files/otter.toml +++ /dev/null @@ -1,7 +0,0 @@ -data_dir = "/mnt/data1/otter/data" -log_level = "debug" - -[net] -type = "tcp" -domain = "0.0.0.0" -port = 8017 diff --git a/roles/otter/tasks/main.yml b/roles/otter/tasks/main.yml index b7c3dbd..997da11 100644 --- a/roles/otter/tasks/main.yml +++ b/roles/otter/tasks/main.yml @@ -1,27 +1,4 @@ --- -- name: Ensure binary is present - ansible.builtin.get_url: - url: 'https://git.rustybever.be/api/packages/Chewing_Bever/generic/otter/0.2.1/otter-linux-arm64' - dest: '/usr/local/bin/otter' - owner: 'root' - group: 'root' - mode: '755' - -- name: Ensure system group exists - ansible.builtin.group: - name: 'otter' - gid: 204 - system: true - state: present - -- name: Ensure system user exists - ansible.builtin.user: - name: 'otter' - group: 'otter' - uid: 204 - system: true - create_home: false - - name: Ensure data directory is present ansible.builtin.file: path: '/mnt/data1/otter' @@ -41,8 +18,8 @@ path: "/mnt/data1/otter/{{ item }}" state: directory mode: '0755' - owner: '204' - group: '204' + owner: '82' + group: '82' loop: - 'data' @@ -52,19 +29,10 @@ state: directory mode: '0755' -# - name: Ensure compose file is present -# ansible.builtin.copy: -# src: 'compose.yml' -# dest: '/etc/otter/compose.yml' -# mode: '0644' -# owner: 'root' -# group: 'root' -# notify: 'restart otter' - -- name: Ensure config file is present +- name: Ensure compose file is present ansible.builtin.copy: - src: 'otter.toml' - dest: '/etc/otter/otter.toml' + src: 'compose.yml' + dest: '/etc/otter/compose.yml' mode: '0644' owner: 'root' group: 'root'