tag plays in playbooks (instead of tasks in roles)
This commit is contained in:
parent
6b19f69135
commit
73e77bde70
10 changed files with 49 additions and 20 deletions
|
|
@ -3,69 +3,98 @@
|
|||
hosts: base_config_hosts
|
||||
roles:
|
||||
- base_config
|
||||
tags:
|
||||
- base_config
|
||||
|
||||
- name: Ensure systemd-networkd config deployment on systemd_networkd_hosts
|
||||
hosts: systemd_networkd_hosts
|
||||
roles:
|
||||
- systemd_networkd
|
||||
tags:
|
||||
- systemd_networkd
|
||||
|
||||
- name: Ensure nftables deployment on nftables_hosts
|
||||
hosts: nftables_hosts
|
||||
roles:
|
||||
- nftables
|
||||
tags:
|
||||
- nftables
|
||||
|
||||
- name: Ensure deployment of infrastructure authorized keys
|
||||
hosts: infrastructure_authorized_keys_hosts
|
||||
roles:
|
||||
- infrastructure_authorized_keys
|
||||
tags:
|
||||
- infrastructure_authorized_keys
|
||||
|
||||
- name: Ensure Nextcloud config
|
||||
hosts: nextcloud_hosts
|
||||
roles:
|
||||
- nextcloud
|
||||
tags:
|
||||
- nextcloud
|
||||
|
||||
- name: Ensure ola deployment on ola_hosts
|
||||
hosts: ola_hosts
|
||||
roles:
|
||||
- ola
|
||||
tags:
|
||||
- ola
|
||||
|
||||
- name: Ensure foobazdmx deployment on foobazdmx_hosts
|
||||
hosts: foobazdmx_hosts
|
||||
roles:
|
||||
- foobazdmx
|
||||
tags:
|
||||
- foobazdmx
|
||||
|
||||
- name: Ensure Dokuwiki config
|
||||
hosts: wiki_hosts
|
||||
roles:
|
||||
- dokuwiki
|
||||
tags:
|
||||
- dokuwiki
|
||||
|
||||
- name: Ensure NetBox deployment on netbox_hosts
|
||||
hosts: netbox_hosts
|
||||
roles:
|
||||
- netbox
|
||||
tags:
|
||||
- netbox
|
||||
|
||||
- name: Ensure NGINX deployment on nginx_hosts, which are also public_reverse_proxy_hosts, before certbot role runs
|
||||
hosts: nginx_hosts:&public_reverse_proxy_hosts
|
||||
roles:
|
||||
- nginx
|
||||
tags:
|
||||
- nginx
|
||||
- public_reverse_proxy
|
||||
|
||||
- name: Ensure certbot and certificate deployment on certbot_hosts
|
||||
hosts: certbot_hosts
|
||||
roles:
|
||||
- certbot
|
||||
tags:
|
||||
- certbot
|
||||
|
||||
- name: Ensure OnlyOffice custom fonts
|
||||
ansible.builtin.import_playbook: onlyoffice_fonts.yaml
|
||||
tags:
|
||||
- onlyoffice_fonts
|
||||
|
||||
- name: Ensure Docker Compose deployment on docker_compose_hosts
|
||||
hosts: docker_compose_hosts
|
||||
roles:
|
||||
- docker_compose
|
||||
tags:
|
||||
- docker_compose
|
||||
|
||||
- name: Ensure NGINX deployment on nginx_hosts
|
||||
hosts: nginx_hosts:!public_reverse_proxy_hosts
|
||||
roles:
|
||||
- nginx
|
||||
tags:
|
||||
- nginx
|
||||
|
||||
- name: Configure unattended upgrades for all non-hypervisors
|
||||
hosts: all:!hypervisors
|
||||
|
|
@ -77,32 +106,46 @@
|
|||
- "o=${distro_id},n=${distro_codename}"
|
||||
- "o=Docker,n=${distro_codename}"
|
||||
- "o=nginx,n=${distro_codename}"
|
||||
tags:
|
||||
- unattended_upgrades
|
||||
|
||||
- name: Ensure Alloy is installed and Setup on alloy_hosts
|
||||
hosts: alloy_hosts
|
||||
become: true
|
||||
roles:
|
||||
- alloy
|
||||
tags:
|
||||
- alloy
|
||||
|
||||
- name: Ensure ansible_pull deployment on ansible_pull_hosts
|
||||
hosts: ansible_pull_hosts
|
||||
roles:
|
||||
- ansible_pull
|
||||
tags:
|
||||
- ansible_pull
|
||||
|
||||
- name: Ensure msmtp is setup on msmtp_hosts
|
||||
hosts: msmtp_hosts
|
||||
roles:
|
||||
- msmtp
|
||||
tags:
|
||||
- msmtp
|
||||
|
||||
- name: Ensure Renovate is setup on renovate_hosts
|
||||
hosts: renovate_hosts
|
||||
roles:
|
||||
- renovate
|
||||
tags:
|
||||
- renovate
|
||||
|
||||
- name: Run ensure_eh22_styleguide_dir Playbook
|
||||
ansible.builtin.import_playbook: ensure_eh22_styleguide_dir.yaml
|
||||
tags:
|
||||
- eh22_styleguide_dir
|
||||
|
||||
- name: Setup authoritative dns servers
|
||||
hosts: auth-dns
|
||||
roles:
|
||||
- knot
|
||||
tags:
|
||||
- knot
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
- name: Ensure NGINX repo setup and nginx install on relevant hosts
|
||||
hosts: nginx_hosts:nextcloud_hosts
|
||||
tags:
|
||||
- nextcloud_nginx
|
||||
tasks:
|
||||
- name: Ensure NGINX repo is setup
|
||||
ansible.builtin.include_role:
|
||||
|
|
@ -13,6 +15,8 @@
|
|||
|
||||
- name: Ensure Docker repo setup and package install on relevant hosts
|
||||
hosts: docker_compose_hosts:nextcloud_hosts
|
||||
tags:
|
||||
- nextcloud_docker
|
||||
tasks:
|
||||
- name: Ensure Docker repo is setup
|
||||
ansible.builtin.include_role:
|
||||
|
|
@ -28,6 +32,8 @@
|
|||
hosts: all:!hypervisors
|
||||
roles:
|
||||
- apt_update_and_upgrade
|
||||
tags:
|
||||
- apt_update_and_upgrade
|
||||
|
||||
- name: Run deploy Playbook
|
||||
ansible.builtin.import_playbook: deploy.yaml
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
---
|
||||
- name: "reload systemd-resolved"
|
||||
tags: [ "deploy_systemd_resolved_config" ]
|
||||
become: true
|
||||
ansible.builtin.systemd:
|
||||
name: "systemd-resolved.service"
|
||||
|
|
|
|||
|
|
@ -1,13 +1,11 @@
|
|||
---
|
||||
- name: Ensure /etc/resolv.conf is a plain file
|
||||
tags: [ "deploy_systemd_resolved_config" ]
|
||||
become: true
|
||||
ansible.builtin.file:
|
||||
path: "/etc/resolv.conf"
|
||||
state: file
|
||||
|
||||
- name: Write nameserver config directly into /etc/resolv.conf
|
||||
tags: [ "deploy_systemd_resolved_config" ]
|
||||
become: true
|
||||
ansible.builtin.template:
|
||||
src: "resolv.conf.j2"
|
||||
|
|
@ -17,7 +15,6 @@
|
|||
mode: u=rw,g=r,o=r
|
||||
|
||||
- name: Disable systemd-resolved
|
||||
tags: [ "deploy_systemd_resolved_config" ]
|
||||
become: true
|
||||
ansible.builtin.systemd:
|
||||
name: "systemd-resolved.service"
|
||||
|
|
|
|||
|
|
@ -1,13 +1,11 @@
|
|||
---
|
||||
- name: Ensure systemd-resolved is installed
|
||||
tags: [ "deploy_systemd_resolved_config" ]
|
||||
become: true
|
||||
when: ansible_facts["distribution"] == "Debian"
|
||||
ansible.builtin.package:
|
||||
name: [ "systemd-resolved" ]
|
||||
|
||||
- name: Deploy systemd-resolved config
|
||||
tags: [ "deploy_systemd_resolved_config" ]
|
||||
become: true
|
||||
notify: "reload systemd-resolved"
|
||||
ansible.builtin.template:
|
||||
|
|
@ -18,7 +16,6 @@
|
|||
mode: u=rw,g=r,o=r
|
||||
|
||||
- name: Make /etc/resolv.conf points to systemd-resolved
|
||||
tags: [ "deploy_systemd_resolved_config" ]
|
||||
become: true
|
||||
when: deploy_systemd_resolved_config__mode != "extern"
|
||||
ansible.builtin.file: # noqa: jinja
|
||||
|
|
@ -35,7 +32,6 @@
|
|||
{%- endif -%}
|
||||
|
||||
- name: Ensure systemd-resolved is running and enabled
|
||||
tags: [ "deploy_systemd_resolved_config" ]
|
||||
become: true
|
||||
ansible.builtin.systemd:
|
||||
name: systemd-resolved.service
|
||||
|
|
|
|||
|
|
@ -1,10 +1,8 @@
|
|||
---
|
||||
- name: Include enable.yaml
|
||||
tags: [ "deploy_systemd_resolved_config" ]
|
||||
ansible.builtin.include_tasks: enable.yaml
|
||||
when: deploy_systemd_resolved_config__enable
|
||||
|
||||
- name: Include disable.yaml
|
||||
tags: [ "deploy_systemd_resolved_config" ]
|
||||
ansible.builtin.include_tasks: disable.yaml
|
||||
when: not deploy_systemd_resolved_config__enable
|
||||
|
|
|
|||
|
|
@ -1,19 +1,16 @@
|
|||
---
|
||||
- name: reload knot
|
||||
tags: [ auth-dns ]
|
||||
become: true
|
||||
ansible.builtin.systemd:
|
||||
name: knot.service
|
||||
state: reloaded
|
||||
|
||||
- name: netplan apply
|
||||
tags: [ auth-dns ]
|
||||
become: true
|
||||
changed_when: true
|
||||
ansible.builtin.command: "netplan apply"
|
||||
|
||||
- name: restart knot-exporter
|
||||
tags: [ auth-dns ]
|
||||
become: true
|
||||
ansible.builtin.systemd:
|
||||
name: knot-exporter.service
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
---
|
||||
- name: Install knot
|
||||
tags: [ auth-dns ]
|
||||
become: true
|
||||
ansible.builtin.package:
|
||||
name:
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
---
|
||||
- name: Ensure required directories exist
|
||||
tags: [ auth-dns ]
|
||||
become: true
|
||||
loop: [ "/etc/knot", "/etc/knot/zones" ]
|
||||
ansible.builtin.file:
|
||||
|
|
@ -11,7 +10,6 @@
|
|||
mode: u=rwx,g=rx,o=
|
||||
|
||||
- name: Deploy knot configuration file
|
||||
tags: [ auth-dns ]
|
||||
become: true
|
||||
notify: reload knot
|
||||
ansible.builtin.template:
|
||||
|
|
@ -22,7 +20,6 @@
|
|||
mode: u=rw,g=r,o=
|
||||
|
||||
- name: Deploy configured zones
|
||||
tags: [ auth-dns ]
|
||||
become: true
|
||||
notify: reload knot
|
||||
loop: "{{ knot__zones }}"
|
||||
|
|
@ -42,7 +39,6 @@
|
|||
# this results in outgoing zone transfers failing because knot will prefer to use the dynamic address over the statically configured one.
|
||||
# so because we are configuring a DNS Nameserver where known IP-Addresses are actually important for ACL reasons, SLAAC is disabled
|
||||
- name: Disable IPv6 SLAAC
|
||||
tags: [ auth-dns ]
|
||||
become: true
|
||||
notify: netplan apply
|
||||
ansible.builtin.template:
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
- name: Deploy knot-exporter systemd unit
|
||||
tags: [ auth-dns ]
|
||||
become: true
|
||||
register: knot_deploy_service_file
|
||||
notify: restart knot-exporter
|
||||
|
|
@ -11,7 +10,6 @@
|
|||
mode: u=rw,g=r,o=r
|
||||
|
||||
- name: Ensure knot-exporter is running and enabled
|
||||
tags: [ auth-dns ]
|
||||
become: true
|
||||
ansible.builtin.systemd:
|
||||
name: knot-exporter.service
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue