diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..23c4cb3 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,7 @@ +--- +version: 2 +updates: + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "weekly" diff --git a/.github/workflows/run-integration-test.yml b/.github/workflows/run-integration-test.yml index 65496f4..5555936 100644 --- a/.github/workflows/run-integration-test.yml +++ b/.github/workflows/run-integration-test.yml @@ -11,7 +11,7 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v4 + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - name: Override libvirt socket permissions run: | @@ -31,7 +31,7 @@ jobs: xz-utils - name: Setup Tofu - uses: opentofu/setup-opentofu@v1 + uses: opentofu/setup-opentofu@a1320f892987e89d278cc92dc5adc984fb93aca4 # v2.0.2 with: tofu_version: latest @@ -66,7 +66,7 @@ jobs: - name: Prepare ansible run: | install -m 0644 .github/workflow-templates/ci-vault.yml configuration-files/group_vars/local/vault.yml - ansible-galaxy install -f -r requirements.yml + ansible-galaxy install -f -r configuration-files/requirements.yml - name: Run ansible run: | @@ -93,7 +93,7 @@ jobs: git diff .github/workflow-fixtures/testssl-results - name: Upload testssl results - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 if: always() with: name: testssl-results @@ -109,7 +109,7 @@ jobs: ssh -p 55022 localdns2 sudo tar -C /var/log -c . > system-logs/localdns2.tar - name: Upload system logs - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 if: always() with: name: system-logs diff --git a/.github/workflows/run-lint.yml b/.github/workflows/run-lint.yml index c7524fb..3923a6c 100644 --- a/.github/workflows/run-lint.yml +++ b/.github/workflows/run-lint.yml @@ -10,9 +10,10 @@ jobs: steps: - name: Check out project - uses: actions/checkout@v3 + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - - name: Check project formating - uses: creyD/prettier_action@v4.3 + - name: Run ansible-lint + uses: ansible/ansible-lint@e7f397ad6dfa20d274afa17cd7bbedd84ed136f5 # v26.9.0 with: - prettier_options: --check . + requirements_file: "requirements.yml" + working_directory: "configuration-files" diff --git a/configuration-files/.ansible-lint-ignore b/configuration-files/.ansible-lint-ignore new file mode 100644 index 0000000..1b4b106 --- /dev/null +++ b/configuration-files/.ansible-lint-ignore @@ -0,0 +1,7 @@ +# This file contains ignores rule violations for ansible-lint +roles/base/defaults/main.yml var-naming[no-role-prefix] +roles/dns_backend/defaults/main.yml var-naming[no-role-prefix] +roles/dns_backend/vars/main.yml var-naming[no-role-prefix] +roles/dns_frontend/defaults/main.yml var-naming[no-role-prefix] +roles/dns_frontend/vars/main.yml var-naming[no-role-prefix] +roles/monitoring/vars/main.yml var-naming[no-role-prefix] diff --git a/configuration-files/requirements.yml b/configuration-files/requirements.yml new file mode 100644 index 0000000..7e38aa1 --- /dev/null +++ b/configuration-files/requirements.yml @@ -0,0 +1,8 @@ +--- +collections: + - name: ansible.posix + version: 2.2.2 + - name: community.crypto + version: 3.4.0 + - name: community.general + version: 13.4.0 diff --git a/configuration-files/resolver.yml b/configuration-files/resolver.yml index d82e6d7..e2b45d4 100644 --- a/configuration-files/resolver.yml +++ b/configuration-files/resolver.yml @@ -1,14 +1,16 @@ --- -- hosts: all +- name: Prepare resolver + hosts: all become: true pre_tasks: - name: Update Repository Index tags: always - apt: - update_cache: yes + ansible.builtin.apt: + update_cache: true changed_when: false -- hosts: all +- name: Setup resolver + hosts: all become: true roles: - base diff --git a/configuration-files/roles/base/handlers/main.yml b/configuration-files/roles/base/handlers/main.yml index 937df16..b9e13d5 100644 --- a/configuration-files/roles/base/handlers/main.yml +++ b/configuration-files/roles/base/handlers/main.yml @@ -1,22 +1,23 @@ --- -- name: restart ssh.socket - when: ssh_socket_is_active.rc == 0 - systemd_service: +- name: Restart ssh.socket + when: base_ssh_socket_is_active.rc == 0 + ansible.builtin.systemd_service: name: ssh.socket state: restarted daemon_reload: true -- name: restart ssh - service: +- name: Restart ssh + ansible.builtin.service: name: ssh state: restarted -- name: firewall | apply ruleset - systemd_service: +- name: Firewall | apply ruleset + ansible.builtin.systemd_service: name: nftables state: reloaded -- name: apply netplan - command: sudo netplan apply +- name: Apply netplan async: 45 poll: 0 + changed_when: true + ansible.builtin.command: netplan apply diff --git a/configuration-files/roles/base/software/packages_cleanup.yml b/configuration-files/roles/base/software/packages_cleanup.yml index 3ce6a0c..5e21351 100644 --- a/configuration-files/roles/base/software/packages_cleanup.yml +++ b/configuration-files/roles/base/software/packages_cleanup.yml @@ -1,6 +1,6 @@ --- -- name: software | remove obsolete software packages - package: +- name: Software | remove obsolete software packages + ansible.builtin.package: state: absent name: - cowsay diff --git a/configuration-files/roles/base/software/packages_utilities.yml b/configuration-files/roles/base/software/packages_utilities.yml index ecb1be4..d05c4c9 100644 --- a/configuration-files/roles/base/software/packages_utilities.yml +++ b/configuration-files/roles/base/software/packages_utilities.yml @@ -1,7 +1,7 @@ --- -- name: software | install utility packages - package: - state: latest +- name: Software | install utility packages + ansible.builtin.package: + state: present name: - curl - dnsutils diff --git a/configuration-files/roles/base/tasks/firewall.yml b/configuration-files/roles/base/tasks/firewall.yml index 92b6755..aeab788 100644 --- a/configuration-files/roles/base/tasks/firewall.yml +++ b/configuration-files/roles/base/tasks/firewall.yml @@ -1,13 +1,13 @@ --- -- name: firewall | install software - package: - state: latest +- name: Firewall | install software + ansible.builtin.package: + state: present name: - iptables - nftables -- name: firewall | uninstall software - package: +- name: Firewall | uninstall software + ansible.builtin.package: state: absent name: - iptables-persistent @@ -16,31 +16,30 @@ # Load firewall connection tracking kernel modules and reconnect. -- name: firewall | load kernel modules - modprobe: +- name: Firewall | load kernel modules + community.general.modprobe: name: xt_conntrack -- name: firewall | reset connection - meta: reset_connection - -- name: firewall | cleanup - file: +- name: Firewall | reset connection + ansible.builtin.meta: reset_connection +- name: Firewall | cleanup + ansible.builtin.file: state: absent path: /etc/iptables -- name: firewall | rules +- name: Firewall | rules notify: - - firewall | apply ruleset - template: + - Firewall | apply ruleset + ansible.builtin.template: src: nftables.conf.j2 dest: /etc/nftables.conf validate: /usr/sbin/nft --check --file %s owner: root group: root - mode: 0644 + mode: "0644" -- name: firewall | enabled - service: +- name: Firewall | enabled + ansible.builtin.service: name: nftables state: started enabled: true diff --git a/configuration-files/roles/base/tasks/main.yml b/configuration-files/roles/base/tasks/main.yml index d79180e..6c85cef 100644 --- a/configuration-files/roles/base/tasks/main.yml +++ b/configuration-files/roles/base/tasks/main.yml @@ -3,26 +3,29 @@ tags: base block: - name: Setup Network - import_tasks: network.yml + ansible.builtin.import_tasks: network.yml tags: network,init - name: Setup Users tags: init - include_tasks: "{{ item }}" + ansible.builtin.include_tasks: "{{ item }}" with_fileglob: - users/*.yml - name: Setup Software tags: init block: - - import_tasks: unattended-upgrades.yml - - import_tasks: software/packages_cleanup.yml - - import_tasks: software/packages_utilities.yml + - name: Setup unattended-upgrades + ansible.builtin.import_tasks: unattended-upgrades.yml + - name: Cleanup packages + ansible.builtin.import_tasks: software/packages_cleanup.yml + - name: Setup utilities + ansible.builtin.import_tasks: software/packages_utilities.yml - name: Setup Firewall - import_tasks: firewall.yml + ansible.builtin.import_tasks: firewall.yml tags: firewall - name: Setup SSH tags: ssh,init - import_tasks: sshd.yml + ansible.builtin.import_tasks: sshd.yml diff --git a/configuration-files/roles/base/tasks/network.yml b/configuration-files/roles/base/tasks/network.yml index 5f73358..1ed1083 100644 --- a/configuration-files/roles/base/tasks/network.yml +++ b/configuration-files/roles/base/tasks/network.yml @@ -4,20 +4,20 @@ - all - default - "{{ if_primary }}" - sysctl: + ansible.posix.sysctl: name: "net.ipv6.conf.{{ item }}.accept_dad" - value: '0' + value: "0" sysctl_set: true sysctl_file: /etc/sysctl.d/99-disable-dad-ipv6.conf state: present reload: true - name: Generate network config file from template - template: + ansible.builtin.template: src: 00-installer-config.yaml.j2 dest: /etc/netplan/00-installer-config.yaml owner: root group: root mode: "0644" notify: - - apply netplan + - Apply netplan diff --git a/configuration-files/roles/base/tasks/sshd.yml b/configuration-files/roles/base/tasks/sshd.yml index 9cb0843..a32ccd5 100644 --- a/configuration-files/roles/base/tasks/sshd.yml +++ b/configuration-files/roles/base/tasks/sshd.yml @@ -3,28 +3,28 @@ # ubuntu releases where the socket unit is not present. Note that the drop-in # is installed regardless of the result here. This is done to ensure ssh will # start on the correct port after a dist-upgrade. -- name: ssh | check if systemd ssh.socket unit is active +- name: SSH | check if systemd ssh.socket unit is active changed_when: false failed_when: false - register: ssh_socket_is_active - command: + register: base_ssh_socket_is_active + ansible.builtin.command: argv: - /usr/bin/systemctl - is-active - ssh.socket -- name: ssh | systemd ssh.socket unit drop-in directory present - file: +- name: SSH | systemd ssh.socket unit drop-in directory present + ansible.builtin.file: state: directory path: /etc/systemd/system/ssh.socket.d owner: root group: root - mode: 0755 + mode: "0755" -- name: ssh | systemd ssh.socket unit drop-in present +- name: SSH | systemd ssh.socket unit drop-in present notify: - - restart ssh.socket - copy: + - Restart ssh.socket + ansible.builtin.copy: content: | [Socket] ListenStream= @@ -33,13 +33,13 @@ dest: /etc/systemd/system/ssh.socket.d/50-port.conf owner: root group: root - mode: 0644 + mode: "0644" -- name: ssh | configure sshd - lineinfile: +- name: SSH | configure sshd + ansible.builtin.lineinfile: path: "/etc/ssh/sshd_config" - regex: "^(#)?{{item.key}}" - line: "{{item.key}} {{item.value}}" + regex: "^(#)?{{ item.key }}" + line: "{{ item.key }} {{ item.value }}" state: present loop: - { key: "AllowAgentForwarding", value: "no" } # disable tunneling feature @@ -48,10 +48,11 @@ - { key: "GSSAPIAuthentication", value: "no" } # disable authentication method - { key: "KerberosAuthentication", value: "no" } # disable authentication method - { key: "PasswordAuthentication", value: "no" } # disable SSH password authentication - - { key: "PermitEmptyPasswords", value: "no" } # disable authentication with empty passwords. This prevent logins if a user’s password is set to a blank or empty value + # disable authentication with empty passwords. This prevent logins if a user’s password is set to a blank or empty value + - { key: "PermitEmptyPasswords", value: "no" } - { key: "PermitRootLogin", value: "no" } # disable logging in via SSH as the root user - { key: "PermitTunnel", value: "no" } # disable tunneling feature - { key: "Port", value: "{{ network_port_ssh }}" } # use custom listening port - { key: "X11Forwarding", value: "no" } # disable unused X11 forwarding, console access only notify: - - restart ssh + - Restart ssh diff --git a/configuration-files/roles/base/tasks/unattended-upgrades.yml b/configuration-files/roles/base/tasks/unattended-upgrades.yml index 16874c8..4f6537a 100644 --- a/configuration-files/roles/base/tasks/unattended-upgrades.yml +++ b/configuration-files/roles/base/tasks/unattended-upgrades.yml @@ -1,11 +1,11 @@ --- -- name: unattended-upgrades | install - package: - state: latest +- name: Unattended upgrades | install + ansible.builtin.package: + state: present name: unattended-upgrades -- name: unattended-upgrades | ensure service is enabled and running - service: +- name: Unattended upgrades | ensure service is enabled and running + ansible.builtin.service: name: unattended-upgrades state: started - enabled: yes + enabled: true diff --git a/configuration-files/roles/dns_backend/handlers/main.yml b/configuration-files/roles/dns_backend/handlers/main.yml index 91239c1..d82617b 100644 --- a/configuration-files/roles/dns_backend/handlers/main.yml +++ b/configuration-files/roles/dns_backend/handlers/main.yml @@ -1,5 +1,5 @@ --- -- name: restart unbound - service: +- name: Restart unbound + ansible.builtin.service: name: unbound state: restarted diff --git a/configuration-files/roles/dns_backend/tasks/main.yml b/configuration-files/roles/dns_backend/tasks/main.yml index 7fa2eed..80df5d2 100644 --- a/configuration-files/roles/dns_backend/tasks/main.yml +++ b/configuration-files/roles/dns_backend/tasks/main.yml @@ -2,5 +2,7 @@ - name: Setup DNS Backend tags: backend block: - - import_tasks: unbound.yml - - import_tasks: systemd-resolved.yml + - name: Setup unbound + ansible.builtin.import_tasks: unbound.yml + - name: Disable systemd-resolved + ansible.builtin.import_tasks: systemd-resolved.yml diff --git a/configuration-files/roles/dns_backend/tasks/systemd-resolved.yml b/configuration-files/roles/dns_backend/tasks/systemd-resolved.yml index 52626c5..f4e7973 100644 --- a/configuration-files/roles/dns_backend/tasks/systemd-resolved.yml +++ b/configuration-files/roles/dns_backend/tasks/systemd-resolved.yml @@ -1,12 +1,12 @@ --- -- name: unbound | disable ubuntu systemd-resolved - service: +- name: Unbound | disable ubuntu systemd-resolved + ansible.builtin.service: name: systemd-resolved state: stopped enabled: false -- name: unbound | configure system to use unbound resolver - template: +- name: Unbound | configure system to use unbound resolver + ansible.builtin.template: src: resolv.conf.j2 dest: /etc/resolv.conf owner: root diff --git a/configuration-files/roles/dns_backend/tasks/unbound.yml b/configuration-files/roles/dns_backend/tasks/unbound.yml index ab58d26..3aec7a2 100644 --- a/configuration-files/roles/dns_backend/tasks/unbound.yml +++ b/configuration-files/roles/dns_backend/tasks/unbound.yml @@ -1,38 +1,38 @@ --- -- name: unbound | install - package: - state: latest +- name: Unbound | install + ansible.builtin.package: + state: present name: unbound -- name: unbound | increase socket buffer size +- name: Unbound | increase socket buffer size loop: - rmem_max - wmem_max - sysctl: + ansible.posix.sysctl: name: "net.core.{{ item }}" - value: '8388608' + value: "8388608" sysctl_set: true sysctl_file: /etc/sysctl.d/99-socket-buffer-size.conf state: present reload: true -- name: unbound | started - service: +- name: Unbound | started + ansible.builtin.service: name: unbound state: started -- name: unbound | control key present - command: +- name: Unbound | control key present + ansible.builtin.command: argv: - /usr/sbin/unbound-control-setup creates: /etc/unbound/unbound_server.pem -- name: unbound | generate config file from template - template: +- name: Unbound | generate config file from template + ansible.builtin.template: src: unbound.conf.j2 dest: /etc/unbound/unbound.conf owner: root group: unbound mode: "0644" notify: - - restart unbound + - Restart unbound diff --git a/configuration-files/roles/dns_frontend/handlers/main.yml b/configuration-files/roles/dns_frontend/handlers/main.yml index d5129f0..6e15315 100644 --- a/configuration-files/roles/dns_frontend/handlers/main.yml +++ b/configuration-files/roles/dns_frontend/handlers/main.yml @@ -1,5 +1,5 @@ --- -- name: restart dnsdist - service: +- name: Restart dnsdist + ansible.builtin.service: name: dnsdist state: restarted diff --git a/configuration-files/roles/dns_frontend/tasks/dnsdist.yml b/configuration-files/roles/dns_frontend/tasks/dnsdist.yml index 0411a99..f945cd6 100644 --- a/configuration-files/roles/dns_frontend/tasks/dnsdist.yml +++ b/configuration-files/roles/dns_frontend/tasks/dnsdist.yml @@ -1,40 +1,40 @@ --- -- name: dnsdist | install - package: - state: latest +- name: PowerDNS dnsdist | install + ansible.builtin.package: + state: present name: dnsdist -- name: dnsdist | check if service certificate available - stat: - path: "{{ cert_path}}live/{{ host_public }}.{{ domain }}.ecdsa/" - register: service_certificate +- name: PowerDNS dnsdist | check if service certificate available + ansible.builtin.stat: + path: "{{ cert_path }}live/{{ host_public }}.{{ domain }}.ecdsa/" + register: dns_frontend_certificate -- name: "dnsdist | ensure dnsdist is {{ not service_certificate.stat.exists | ternary('masked', 'not masked') }}" - systemd_service: +- name: "PowerDNS dnsdist | ensure dnsdist is {{ not dns_frontend_certificate.stat.exists | ternary('masked', 'not masked') }}" + ansible.builtin.systemd_service: name: dnsdist - masked: "{{ not service_certificate.stat.exists }}" + masked: "{{ not dns_frontend_certificate.stat.exists }}" -- name: dnsdist | generate config file from template - template: +- name: PowerDNS dnsdist | generate config file from template + ansible.builtin.template: src: dnsdist.yml.j2 dest: /etc/dnsdist/dnsdist.yml owner: root group: _dnsdist mode: "0644" - when: service_certificate.stat.exists + when: dns_frontend_certificate.stat.exists notify: - - restart dnsdist + - Restart dnsdist -- name: dnsdist | remove legacy config file - file: +- name: PowerDNS dnsdist | remove legacy config file + ansible.builtin.file: state: absent dest: /etc/dnsdist/dnsdist.conf - when: service_certificate.stat.exists + when: dns_frontend_certificate.stat.exists notify: - - restart dnsdist + - Restart dnsdist -- name: dnsdist | ensure dnsdist is started - service: +- name: PowerDNS dnsdist | ensure dnsdist is started + ansible.builtin.service: name: dnsdist state: started - when: service_certificate.stat.exists + when: dns_frontend_certificate.stat.exists diff --git a/configuration-files/roles/dns_frontend/tasks/main.yml b/configuration-files/roles/dns_frontend/tasks/main.yml index da5903d..b24a722 100644 --- a/configuration-files/roles/dns_frontend/tasks/main.yml +++ b/configuration-files/roles/dns_frontend/tasks/main.yml @@ -2,5 +2,7 @@ - name: Setup DNS Frontend tags: frontend block: - - import_tasks: powerdns-repo.yml - - import_tasks: dnsdist.yml + - name: Setup PowerDNS repo + ansible.builtin.import_tasks: powerdns-repo.yml + - name: Setup dnsdist + ansible.builtin.import_tasks: dnsdist.yml diff --git a/configuration-files/roles/dns_frontend/tasks/powerdns-repo.yml b/configuration-files/roles/dns_frontend/tasks/powerdns-repo.yml index 68c8b70..4563622 100644 --- a/configuration-files/roles/dns_frontend/tasks/powerdns-repo.yml +++ b/configuration-files/roles/dns_frontend/tasks/powerdns-repo.yml @@ -1,28 +1,28 @@ --- -- name: powerdns-repo | pinning - copy: +- name: PowerDNS repo | pinning + ansible.builtin.copy: src: dnsdist.pref dest: /etc/apt/preferences.d/dnsdist.pref owner: root group: root - mode: 0644 + mode: "0644" -- name: powerdns-repo | keyring - copy: +- name: PowerDNS repo | keyring + ansible.builtin.copy: src: FD380FBB-pub.asc dest: /etc/apt/keyrings/FD380FBB-pub.asc owner: root group: root - mode: 0644 + mode: "0644" -- name: powerdns-repo | sources - copy: +- name: PowerDNS repo | sources + ansible.builtin.copy: src: dnsdist.sources dest: /etc/apt/sources.list.d owner: root group: root - mode: 0644 + mode: "0644" -- name: powerdns-repo | apt cache up-to-date - apt: +- name: PowerDNS repo | apt cache up-to-date + ansible.builtin.apt: update_cache: true diff --git a/configuration-files/roles/dns_frontend/vars/main.yml b/configuration-files/roles/dns_frontend/vars/main.yml index b7d7575..115bc5d 100644 --- a/configuration-files/roles/dns_frontend/vars/main.yml +++ b/configuration-files/roles/dns_frontend/vars/main.yml @@ -4,4 +4,3 @@ vip_interfaces: - "[{{ ip6_vip_dns1 }}]" - "{{ ip4_vip_dns2 }}" - "[{{ ip6_vip_dns2 }}]" - diff --git a/configuration-files/roles/high_availability/handlers/main.yml b/configuration-files/roles/high_availability/handlers/main.yml index 3bef305..57b85b5 100644 --- a/configuration-files/roles/high_availability/handlers/main.yml +++ b/configuration-files/roles/high_availability/handlers/main.yml @@ -1,5 +1,5 @@ --- -- name: reload keepalived - service: +- name: Reload keepalived + ansible.builtin.service: name: keepalived state: reloaded diff --git a/configuration-files/roles/high_availability/tasks/keepalived.yml b/configuration-files/roles/high_availability/tasks/keepalived.yml index dd69a98..939d0f9 100644 --- a/configuration-files/roles/high_availability/tasks/keepalived.yml +++ b/configuration-files/roles/high_availability/tasks/keepalived.yml @@ -1,20 +1,20 @@ --- -- name: keepalived | install - package: - state: latest +- name: Keepalived | install + ansible.builtin.package: + state: present name: keepalived -- name: keepalived | ensure keepalived is started - service: +- name: Keepalived | ensure keepalived is started + ansible.builtin.service: name: keepalived state: started -- name: keepalived | generate config file from template - template: +- name: Keepalived | generate config file from template + ansible.builtin.template: src: keepalived.conf.j2 dest: /etc/keepalived/keepalived.conf owner: root group: root mode: "0644" notify: - - reload keepalived + - Reload keepalived diff --git a/configuration-files/roles/high_availability/tasks/main.yml b/configuration-files/roles/high_availability/tasks/main.yml index 8335808..012743b 100644 --- a/configuration-files/roles/high_availability/tasks/main.yml +++ b/configuration-files/roles/high_availability/tasks/main.yml @@ -2,4 +2,5 @@ - name: Setup High Availability tags: highavailability block: - - import_tasks: keepalived.yml + - name: Setup keepalived + ansible.builtin.import_tasks: keepalived.yml diff --git a/configuration-files/roles/monitoring/handlers/main.yml b/configuration-files/roles/monitoring/handlers/main.yml index 3824594..60c2226 100644 --- a/configuration-files/roles/monitoring/handlers/main.yml +++ b/configuration-files/roles/monitoring/handlers/main.yml @@ -1,8 +1,8 @@ --- -- name: restart munin +- name: Restart munin loop: - "munin" - "munin-node" - service: + ansible.builtin.service: name: "{{ item }}" state: restarted diff --git a/configuration-files/roles/monitoring/tasks/main.yml b/configuration-files/roles/monitoring/tasks/main.yml index ba79f2e..6009bd3 100644 --- a/configuration-files/roles/monitoring/tasks/main.yml +++ b/configuration-files/roles/monitoring/tasks/main.yml @@ -2,4 +2,5 @@ - name: Setup Monitoring tags: monitoring block: - - import_tasks: munin.yml + - name: Setup munin + ansible.builtin.import_tasks: munin.yml diff --git a/configuration-files/roles/monitoring/tasks/munin.yml b/configuration-files/roles/monitoring/tasks/munin.yml index 1222c74..14ce489 100644 --- a/configuration-files/roles/monitoring/tasks/munin.yml +++ b/configuration-files/roles/monitoring/tasks/munin.yml @@ -1,13 +1,13 @@ --- -- name: munin | install - package: - state: latest +- name: Munin | install + ansible.builtin.package: + state: present name: - munin - conntrack -- name: munin | add unbound statistics - blockinfile: +- name: Munin | add unbound statistics + ansible.builtin.blockinfile: path: /etc/munin/plugin-conf.d/munin-node block: | [unbound*] @@ -19,19 +19,19 @@ [fw_*] user root notify: - - restart munin + - Restart munin -- name: munin | make munin less verbose - lineinfile: +- name: Munin | make munin less verbose + ansible.builtin.lineinfile: path: "/etc/munin/munin-node.conf" - regex: "^(#)?{{item.key}}" - line: "{{item.key}} {{item.value}}" + regex: "^(#)?{{ item.key }}" + line: "{{ item.key }} {{ item.value }}" state: present loop: - { key: "log_level", value: "0" } -- name: munin | configure symlinks - file: +- name: Munin | configure symlinks + ansible.builtin.file: src: "/usr/share/munin/plugins/{{ item.from }}" dest: "/etc/munin/plugins/{{ item.to }}" state: link @@ -67,10 +67,10 @@ - { from: "fw_conntrack", to: "fw_conntrack" } - { from: "fw_packets", to: "fw_packets" } notify: - - restart munin + - Restart munin -- name: munin | generate htaccess file - template: +- name: Munin | generate htaccess file + ansible.builtin.template: src: htpasswd.j2 dest: /var/cache/munin/www/.htpasswd owner: root diff --git a/configuration-files/roles/web_server/handlers/main.yml b/configuration-files/roles/web_server/handlers/main.yml index 6deed0c..3ba7687 100644 --- a/configuration-files/roles/web_server/handlers/main.yml +++ b/configuration-files/roles/web_server/handlers/main.yml @@ -1,5 +1,5 @@ --- -- name: restart nginx - service: +- name: Restart nginx + ansible.builtin.service: name: nginx state: restarted diff --git a/configuration-files/roles/web_server/tasks/letsencrypt.yml b/configuration-files/roles/web_server/tasks/letsencrypt.yml index 37e6284..c9ec51b 100644 --- a/configuration-files/roles/web_server/tasks/letsencrypt.yml +++ b/configuration-files/roles/web_server/tasks/letsencrypt.yml @@ -1,11 +1,11 @@ --- -- name: lets encrypt | install +- name: Let's Encrypt | install community.general.snap: name: certbot classic: true -- name: lets encrypt | symlink certbot - file: +- name: Let's Encrypt | symlink certbot + ansible.builtin.file: src: "/snap/bin/certbot" dest: "/usr/bin/certbot" owner: root @@ -13,29 +13,29 @@ state: link - name: Create cert directory - file: + ansible.builtin.file: path: "{{ cert_path }}live/" state: directory mode: "0755" -- name: lets encrypt | create config dir - file: +- name: Let's Encrypt | create config dir + ansible.builtin.file: path: "{{ cert_path }}" state: directory owner: root group: root mode: "0755" -- name: lets encrypt | create config accounts sub dir - file: +- name: Let's Encrypt | create config accounts sub dir + ansible.builtin.file: path: "{{ cert_path }}accounts" state: directory owner: root group: root mode: "0700" -- name: lets encrypt | create config sub dir - file: +- name: Let's Encrypt | create config sub dir + ansible.builtin.file: path: "{{ cert_path }}{{ item.file }}" state: directory owner: root @@ -47,16 +47,16 @@ - { file: "renewal" } - { file: "renewal-hooks" } -- name: lets encrypt | copy cli config - copy: +- name: Let's Encrypt | copy cli config + ansible.builtin.copy: src: cli.ini dest: "{{ cert_path }}cli.ini" owner: root group: root mode: "0644" -- name: lets encrypt | create acme well known dir - file: +- name: Let's Encrypt | create acme well known dir + ansible.builtin.file: path: /var/run/acme/acme-challenge/.well-known/acme-challenge state: directory owner: root @@ -68,30 +68,33 @@ # curl http://dns1.digitale-gesellschaft.ch/.well-known/acme-challenge/check.txt # curl http://dns2.digitale-gesellschaft.ch/.well-known/acme-challenge/check.txt # returns either "this is host dns1" or "this is host dns2" -- name: lets encrypt | create test file with hostname to verify acme endpoint - copy: +- name: Let's Encrypt | create test file with hostname to verify acme endpoint + ansible.builtin.copy: dest: "/var/run/acme/acme-challenge/.well-known/acme-challenge/check.txt" content: | "this is host {{ inventory_hostname }}" + owner: root + group: root + mode: "0644" -- name: lets encrypt | copy deploy hook - copy: +- name: Let's Encrypt | copy deploy hook + ansible.builtin.copy: src: letsencrypt-deploy-hook dest: /usr/local/sbin/letsencrypt-deploy-hook owner: root group: root mode: "0755" -- name: lets encrypt | generate renewal script from template - template: +- name: Let's Encrypt | generate renewal script from template + ansible.builtin.template: src: letsencrypt-renew.j2 dest: /usr/local/sbin/letsencrypt-renew owner: root group: root mode: "0755" -- name: lets encrypt | create renewal crob job - cron: +- name: Let's Encrypt | create renewal crob job + ansible.builtin.cron: name: "renew certs periodically" user: root weekday: "3" @@ -100,8 +103,8 @@ job: "/usr/local/sbin/letsencrypt-renew" when: inventory_hostname == "dns1" -- name: lets encrypt | create renewal crob job - cron: +- name: Let's Encrypt | create renewal crob job + ansible.builtin.cron: name: "renew certs periodically" user: root weekday: "4" @@ -110,12 +113,5 @@ job: "/usr/local/sbin/letsencrypt-renew" when: inventory_hostname == "dns2" -- name: lets encrypt | check if service certificate available - stat: - path: "{{ cert_path }}live/{{ host_public }}.{{ domain }}.ecdsa" - register: service_certificate - - name: Create Let's Encrypt Certificates, if not existing - block: - - include_tasks: letsencrypt_create.yml - when: not service_certificate.stat.exists + ansible.builtin.include_tasks: letsencrypt_create.yml diff --git a/configuration-files/roles/web_server/tasks/letsencrypt_create.yml b/configuration-files/roles/web_server/tasks/letsencrypt_create.yml index ecefdfa..dc1e788 100644 --- a/configuration-files/roles/web_server/tasks/letsencrypt_create.yml +++ b/configuration-files/roles/web_server/tasks/letsencrypt_create.yml @@ -1,9 +1,53 @@ --- -- name: Create internal ECDSA certificate for {{ name_intern }}.{{ domain }} - command: certbot certonly --config "{{ cert_path }}cli.ini" --key-type ecdsa --cert-name {{ name_intern }}.{{ domain }}.ecdsa -d {{ name_intern }}.{{ domain }} +- name: Create internal ECDSA certificate + ansible.builtin.command: + creates: "{{ cert_path }}live/{{ name_intern }}.{{ domain }}.ecdsa" + argv: + - "/usr/bin/certbot" + - "certonly" + - "--config" + - "{{ cert_path }}cli.ini" + - "--key-type" + - "ecdsa" + - "--cert-name" + - "{{ name_intern }}.{{ domain }}.ecdsa" + - "-d" + - "{{ name_intern }}.{{ domain }}" -- name: Create public ECDSA certificate for [{{ host_public }}|{{ name_public }}|{{ name_other_public }}].{{ domain }} - command: certbot certonly --config "{{ cert_path }}cli.ini" --key-type ecdsa --cert-name {{ host_public}}.{{ domain }}.ecdsa -d {{ host_public }}.{{ domain }} -d {{ name_public }}.{{ domain }} -d {{ name_other_public }}.{{ domain }} +- name: Create public ECDSA certificate + ansible.builtin.command: + creates: "{{ cert_path }}live/{{ host_public }}.{{ domain }}.ecdsa" + argv: + - "/usr/bin/certbot" + - "certonly" + - "--config" + - "{{ cert_path }}cli.ini" + - "--key-type" + - "ecdsa" + - "--cert-name" + - "{{ host_public }}.{{ domain }}.ecdsa" + - "-d" + - "{{ host_public }}.{{ domain }}" + - "-d" + - "{{ name_public }}.{{ domain }}" + - "-d" + - "{{ name_other_public }}.{{ domain }}" -- name: Create public RSA certificate for [{{ host_public }}|{{ name_public }}|{{ name_other_public }}].{{ domain }} - command: certbot certonly --config "{{ cert_path }}cli.ini" --key-type rsa --cert-name {{ host_public}}.{{ domain }}.rsa -d {{ host_public }}.{{ domain }} -d {{ name_public }}.{{ domain }} -d {{ name_other_public }}.{{ domain }} +- name: Create public RSA certificate + ansible.builtin.command: + creates: "{{ cert_path }}live/{{ host_public }}.{{ domain }}.rsa" + argv: + - "/usr/bin/certbot" + - "certonly" + - "--config" + - "{{ cert_path }}cli.ini" + - "--key-type" + - "rsa" + - "--cert-name" + - "{{ host_public }}.{{ domain }}.rsa" + - "-d" + - "{{ host_public }}.{{ domain }}" + - "-d" + - "{{ name_public }}.{{ domain }}" + - "-d" + - "{{ name_other_public }}.{{ domain }}" diff --git a/configuration-files/roles/web_server/tasks/localencrypt.yml b/configuration-files/roles/web_server/tasks/localencrypt.yml index 1cc4e0f..2de56e8 100644 --- a/configuration-files/roles/web_server/tasks/localencrypt.yml +++ b/configuration-files/roles/web_server/tasks/localencrypt.yml @@ -1,13 +1,13 @@ --- - name: Create cert directory - file: + ansible.builtin.file: path: "{{ cert_path }}live/{{ item.name }}/" state: directory mode: "0755" loop: - { name: "{{ name_intern }}.{{ domain }}.ecdsa" } - - { name: "{{ host_public}}.{{ domain }}.ecdsa" } - - { name: "{{ host_public}}.{{ domain }}.rsa" } + - { name: "{{ host_public }}.{{ domain }}.ecdsa" } + - { name: "{{ host_public }}.{{ domain }}.rsa" } - name: Create private keys (without passphrase) community.crypto.openssl_privatekey: @@ -16,66 +16,66 @@ curve: "{{ item.curve | default(omit) }}" # Match group and permissions with letsencrypt-deploy-hook group: "_dnsdist" - mode: 0640 + mode: "0640" loop: - { type: "ECC", curve: "secp256r1", name: "{{ name_intern }}.{{ domain }}.ecdsa" } - - { type: "ECC", curve: "secp256r1", name: "{{ host_public}}.{{ domain }}.ecdsa" } - - { type: "RSA", name: "{{ host_public}}.{{ domain }}.rsa" } + - { type: "ECC", curve: "secp256r1", name: "{{ host_public }}.{{ domain }}.ecdsa" } + - { type: "RSA", name: "{{ host_public }}.{{ domain }}.rsa" } - name: Check if RSA public PEM certificate file exists - stat: + ansible.builtin.stat: path: "{{ cert_path }}live/{{ host_public }}.{{ domain }}.rsa/fullchain.pem" - register: pub_rsa_check + register: web_server_pub_rsa_check - name: Check if ECDSA public PEM certificate file exists - stat: + ansible.builtin.stat: path: "{{ cert_path }}live/{{ host_public }}.{{ domain }}.ecdsa/fullchain.pem" - register: pub_ecdsa_check + register: web_server_pub_ecdsa_check - name: Check if ECDSA intern PEM certificate file exists - stat: + ansible.builtin.stat: path: "{{ cert_path }}live/{{ name_intern }}.{{ domain }}.ecdsa/fullchain.pem" - register: int_ecdsa_check + register: web_server_int_ecdsa_check - name: Create public ECDSA certificate signing request (CSR) community.crypto.openssl_csr_pipe: - privatekey_path: "{{ cert_path }}live/{{ host_public}}.{{ domain }}.ecdsa/privkey.pem" - common_name: "{{ host_public}}.{{ domain }}.ecdsa" + privatekey_path: "{{ cert_path }}live/{{ host_public }}.{{ domain }}.ecdsa/privkey.pem" + common_name: "{{ host_public }}.{{ domain }}.ecdsa" organization_name: "Digitale Gesellschaft" subject_alt_name: - "DNS:{{ host_public }}.{{ domain }}" - "DNS:{{ name_public }}.{{ domain }}" - "DNS:{{ name_other_public }}.{{ domain }}" - register: csr - when: not pub_ecdsa_check.stat.exists + register: web_server_csr + when: not web_server_pub_ecdsa_check.stat.exists - name: Create public self-signed certificate from CSR community.crypto.x509_certificate: - path: "{{ cert_path }}live/{{ host_public}}.{{ domain }}.ecdsa/fullchain.pem" - csr_content: "{{ csr.csr }}" - privatekey_path: "{{ cert_path }}live/{{ host_public}}.{{ domain }}.ecdsa/privkey.pem" + path: "{{ cert_path }}live/{{ host_public }}.{{ domain }}.ecdsa/fullchain.pem" + csr_content: "{{ web_server_csr.csr }}" + privatekey_path: "{{ cert_path }}live/{{ host_public }}.{{ domain }}.ecdsa/privkey.pem" provider: selfsigned - when: not pub_ecdsa_check.stat.exists + when: not web_server_pub_ecdsa_check.stat.exists - name: Create public RSA certificate signing request (CSR) community.crypto.openssl_csr_pipe: - privatekey_path: "{{ cert_path }}live/{{ host_public}}.{{ domain }}.rsa/privkey.pem" - common_name: "{{ host_public}}.{{ domain }}.rsa" + privatekey_path: "{{ cert_path }}live/{{ host_public }}.{{ domain }}.rsa/privkey.pem" + common_name: "{{ host_public }}.{{ domain }}.rsa" organization_name: "Digitale Gesellschaft" subject_alt_name: - "DNS:{{ host_public }}.{{ domain }}" - "DNS:{{ name_public }}.{{ domain }}" - "DNS:{{ name_other_public }}.{{ domain }}" - register: csr - when: not pub_rsa_check.stat.exists + register: web_server_csr + when: not web_server_pub_rsa_check.stat.exists - name: Create public self-signed certificate from CSR community.crypto.x509_certificate: - path: "{{ cert_path }}live/{{ host_public}}.{{ domain }}.rsa/fullchain.pem" - csr_content: "{{ csr.csr }}" - privatekey_path: "{{ cert_path }}live/{{ host_public}}.{{ domain }}.rsa/privkey.pem" + path: "{{ cert_path }}live/{{ host_public }}.{{ domain }}.rsa/fullchain.pem" + csr_content: "{{ web_server_csr.csr }}" + privatekey_path: "{{ cert_path }}live/{{ host_public }}.{{ domain }}.rsa/privkey.pem" provider: selfsigned - when: not pub_rsa_check.stat.exists + when: not web_server_pub_rsa_check.stat.exists - name: Create intern certificate signing request (CSR) community.crypto.openssl_csr_pipe: @@ -84,35 +84,13 @@ organization_name: "Digitale Gesellschaft" subject_alt_name: - "DNS:{{ name_intern }}.{{ domain }}" - register: csr - when: not int_ecdsa_check.stat.exists + register: web_server_csr + when: not web_server_int_ecdsa_check.stat.exists - name: Create public self-signed certificate from CSR community.crypto.x509_certificate: path: "{{ cert_path }}live/{{ name_intern }}.{{ domain }}.ecdsa/fullchain.pem" - csr_content: "{{ csr.csr }}" + csr_content: "{{ web_server_csr.csr }}" privatekey_path: "{{ cert_path }}live/{{ name_intern }}.{{ domain }}.ecdsa/privkey.pem" provider: selfsigned - when: not int_ecdsa_check.stat.exists - - # - #- name: Create full chain files - # copy: - # src: "{{ item.src }}" - # dest: "{{ item.dest }}" - # # path: "{{ cert_path }}live/{{ item.name }}" - # # state: touch - # # mode: "0755" - # loop: - # - { - # src: "{{ cert_path }}live/{{ name_intern }}.{{ domain }}.ecdsa/cert.pem", - # dest: "{{ cert_path }}live/{{ name_intern }}.{{ domain }}.ecdsa/fullchain.pem", - # } - # - { - # src: "{{ cert_path }}live/{{ host_public}}.{{ domain }}.ecdsa/cert.pem", - # dest: "{{ cert_path }}live/{{ host_public}}.{{ domain }}.ecdsa/fullchain.pem", - # } - # - { - # src: "{{ cert_path }}live/{{ host_public}}.{{ domain }}.rsa/cert.pem", - # dest: "{{ cert_path }}live/{{ host_public}}.{{ domain }}.rsa/fullchain.pem", - # } + when: not web_server_int_ecdsa_check.stat.exists diff --git a/configuration-files/roles/web_server/tasks/main.yml b/configuration-files/roles/web_server/tasks/main.yml index 2a3fa55..3e54868 100644 --- a/configuration-files/roles/web_server/tasks/main.yml +++ b/configuration-files/roles/web_server/tasks/main.yml @@ -2,8 +2,11 @@ - name: Setup Webserver tags: webserver block: - - import_tasks: nginx.yml - - import_tasks: letsencrypt.yml + - name: Setup nginx + ansible.builtin.import_tasks: nginx.yml + - name: Setup Let's Encrypt (production) when: inventory_hostname in groups["prod"] - - import_tasks: localencrypt.yml + ansible.builtin.import_tasks: letsencrypt.yml + - name: Setup self-signed certs (testing) when: inventory_hostname in groups["local"] + ansible.builtin.import_tasks: localencrypt.yml diff --git a/configuration-files/roles/web_server/tasks/nginx.yml b/configuration-files/roles/web_server/tasks/nginx.yml index 7eb8ee3..8340b9a 100644 --- a/configuration-files/roles/web_server/tasks/nginx.yml +++ b/configuration-files/roles/web_server/tasks/nginx.yml @@ -1,35 +1,35 @@ --- -- name: nginx | install - package: - state: latest +- name: Nginx | install + ansible.builtin.package: + state: present name: nginx -- name: nginx | ensure nginx is started - service: +- name: Nginx | ensure nginx is started + ansible.builtin.service: name: nginx state: started -- name: nginx | webserver configurations | remove default web server configuration - file: +- name: Nginx | webserver configurations | remove default web server configuration + ansible.builtin.file: path: /etc/nginx/sites-enabled/default state: absent -- name: nginx | webserver configurations | create res www folder - file: +- name: Nginx | webserver configurations | create res www folder + ansible.builtin.file: path: /var/www/res state: directory mode: "0755" -- name: nginx | webserver configurations | copy index.html - copy: +- name: Nginx | webserver configurations | copy index.html + ansible.builtin.copy: src: index.html dest: /var/www/res/index.html owner: root group: root mode: "0644" -- name: nginx | webserver configurations | generate config files from template - template: +- name: Nginx | webserver configurations | generate config files from template + ansible.builtin.template: src: "{{ item.src }}" dest: "/etc/nginx/sites-available/{{ item.dest }}" owner: root @@ -40,10 +40,10 @@ - { src: "res-https.conf.j2", dest: "res-https.conf" } - { src: "res.conf.j2", dest: "res.conf" } notify: - - restart nginx + - Restart nginx -- name: nginx | webserver configurations | activate http config files - file: +- name: Nginx | webserver configurations | activate http config files + ansible.builtin.file: src: "/etc/nginx/sites-available/{{ item.file }}" dest: "/etc/nginx/sites-enabled/{{ item.file }}" owner: root @@ -53,20 +53,20 @@ - { file: "acme.conf" } - { file: "res.conf" } notify: - - restart nginx + - Restart nginx -- name: nginx | check if intern certificate available - stat: +- name: Nginx | check if intern certificate available + ansible.builtin.stat: path: "{{ cert_path }}live/{{ name_intern }}.{{ domain }}.ecdsa" - register: intern_certificate + register: web_server_intern_certificate -- name: nginx | webserver configurations | activate https config files - file: +- name: Nginx | webserver configurations | activate https config files + ansible.builtin.file: src: "/etc/nginx/sites-available/res-https.conf" dest: "/etc/nginx/sites-enabled/res-https.conf" owner: root group: root state: link - when: intern_certificate.stat.exists + when: web_server_intern_certificate.stat.exists notify: - - restart nginx + - Restart nginx diff --git a/configuration-files/smoketest.yml b/configuration-files/smoketest.yml index 8683469..8d073c5 100644 --- a/configuration-files/smoketest.yml +++ b/configuration-files/smoketest.yml @@ -1,7 +1,8 @@ --- -- hosts: all +- name: Smoketest + hosts: all become: false - gather_facts: no + gather_facts: false vars: dns_servers: - "{{ ip4_vip_dns1 }}" @@ -25,7 +26,7 @@ ansible.builtin.command: argv: ["/usr/bin/kdig", "@{{ server }}", "-tTXT", "txt.4KExSeZORLCU0SDx.test", "+retry=0", "+short", "+stats", "{{ transport }}"] - # kdig can't do DoH3 + # kdig can't do DoH3 - name: "Smoketest | doh3 curl" loop: "{{ dns_servers }}" vars: @@ -56,17 +57,69 @@ - name: "Smoketest | testssl | async" loop: - - ["testssl", "--categories", "--forward-secrecy", "--protocols", "--server-preference", "--client-simulation", "--grease", "--vulnerabilities", "--overwrite", "--csvfile", "../.github/workflow-fixtures/testssl-results/{{ ip4_vip_dns1 }}_p443.csv", "--ip", "{{ ip4_vip_dns1 }}", "dns.digitale-gesellschaft.ch:443" ] - - ["testssl", "--categories", "--forward-secrecy", "--protocols", "--server-preference", "--client-simulation", "--grease", "--vulnerabilities", "--overwrite", "--csvfile", "../.github/workflow-fixtures/testssl-results/{{ ip4_vip_dns1 }}_p853.csv", "--ip", "{{ ip4_vip_dns1 }}", "dns.digitale-gesellschaft.ch:853" ] - - ["testssl", "--categories", "--forward-secrecy", "--protocols", "--server-preference", "--client-simulation", "--grease", "--vulnerabilities", "--overwrite", "--csvfile", "../.github/workflow-fixtures/testssl-results/{{ ip4_vip_dns2 }}_p443.csv", "--ip", "{{ ip4_vip_dns2 }}", "dns.digitale-gesellschaft.ch:443" ] - - ["testssl", "--categories", "--forward-secrecy", "--protocols", "--server-preference", "--client-simulation", "--grease", "--vulnerabilities", "--overwrite", "--csvfile", "../.github/workflow-fixtures/testssl-results/{{ ip4_vip_dns2 }}_p853.csv", "--ip", "{{ ip4_vip_dns2 }}", "dns.digitale-gesellschaft.ch:853" ] + - - "testssl" + - "--categories" + - "--forward-secrecy" + - "--protocols" + - "--server-preference" + - "--client-simulation" + - "--grease" + - "--vulnerabilities" + - "--overwrite" + - "--csvfile" + - "../.github/workflow-fixtures/testssl-results/{{ ip4_vip_dns1 }}_p443.csv" + - "--ip" + - "{{ ip4_vip_dns1 }}" + - "dns.digitale-gesellschaft.ch:443" + - - "testssl" + - "--categories" + - "--forward-secrecy" + - "--protocols" + - "--server-preference" + - "--client-simulation" + - "--grease" + - "--vulnerabilities" + - "--overwrite" + - "--csvfile" + - "../.github/workflow-fixtures/testssl-results/{{ ip4_vip_dns1 }}_p853.csv" + - "--ip" + - "{{ ip4_vip_dns1 }}" + - "dns.digitale-gesellschaft.ch:853" + - - "testssl" + - "--categories" + - "--forward-secrecy" + - "--protocols" + - "--server-preference" + - "--client-simulation" + - "--grease" + - "--vulnerabilities" + - "--overwrite" + - "--csvfile" + - "../.github/workflow-fixtures/testssl-results/{{ ip4_vip_dns2 }}_p443.csv" + - "--ip" + - "{{ ip4_vip_dns2 }}" + - "dns.digitale-gesellschaft.ch:443" + - - "testssl" + - "--categories" + - "--forward-secrecy" + - "--protocols" + - "--server-preference" + - "--client-simulation" + - "--grease" + - "--vulnerabilities" + - "--overwrite" + - "--csvfile" + - "../.github/workflow-fixtures/testssl-results/{{ ip4_vip_dns2 }}_p853.csv" + - "--ip" + - "{{ ip4_vip_dns2 }}" + - "dns.digitale-gesellschaft.ch:853" delegate_to: 127.0.0.1 when: ip4 == ip4_dns1 changed_when: false async: 300 poll: 0 register: smoketest_testssl - command: + ansible.builtin.command: argv: "{{ item }}" - name: "Smoketest | testssl | poll" @@ -76,33 +129,33 @@ delegate_to: 127.0.0.1 when: ip4 == ip4_dns1 changed_when: false - register: async_poll_results - until: async_poll_results is finished - failed_when: "async_poll_results.rc > 200" + register: smoketest_async_poll_results + until: smoketest_async_poll_results is finished + failed_when: "smoketest_async_poll_results.rc > 200" retries: 300 - async_status: + ansible.builtin.async_status: jid: "{{ async_result_item.ansible_job_id }}" - name: "Smoketest | testssl | cleanup" loop: - - ["/usr/bin/sed", "-i", "/DROWN_hint/d", "./../.github/workflow-fixtures/testssl-results/{{ ip4_vip_dns1 }}_p443.csv" ] - - ["/usr/bin/sed", "-i", "/DROWN_hint/d", "./../.github/workflow-fixtures/testssl-results/{{ ip4_vip_dns1 }}_p853.csv" ] - - ["/usr/bin/sed", "-i", "/DROWN_hint/d", "./../.github/workflow-fixtures/testssl-results/{{ ip4_vip_dns2 }}_p443.csv" ] - - ["/usr/bin/sed", "-i", "/DROWN_hint/d", "./../.github/workflow-fixtures/testssl-results/{{ ip4_vip_dns2 }}_p853.csv" ] + - ["/usr/bin/sed", "-i", "/DROWN_hint/d", "./../.github/workflow-fixtures/testssl-results/{{ ip4_vip_dns1 }}_p443.csv"] + - ["/usr/bin/sed", "-i", "/DROWN_hint/d", "./../.github/workflow-fixtures/testssl-results/{{ ip4_vip_dns1 }}_p853.csv"] + - ["/usr/bin/sed", "-i", "/DROWN_hint/d", "./../.github/workflow-fixtures/testssl-results/{{ ip4_vip_dns2 }}_p443.csv"] + - ["/usr/bin/sed", "-i", "/DROWN_hint/d", "./../.github/workflow-fixtures/testssl-results/{{ ip4_vip_dns2 }}_p853.csv"] delegate_to: 127.0.0.1 when: ip4 == ip4_dns1 changed_when: false - command: + ansible.builtin.command: argv: "{{ item }}" - name: "Smoketest | testssl | results up-to-date" loop: - - ["/usr/bin/git", "diff", "--quiet", "./../.github/workflow-fixtures/testssl-results/{{ ip4_vip_dns1 }}_p443.csv" ] - - ["/usr/bin/git", "diff", "--quiet", "./../.github/workflow-fixtures/testssl-results/{{ ip4_vip_dns1 }}_p853.csv" ] - - ["/usr/bin/git", "diff", "--quiet", "./../.github/workflow-fixtures/testssl-results/{{ ip4_vip_dns2 }}_p443.csv" ] - - ["/usr/bin/git", "diff", "--quiet", "./../.github/workflow-fixtures/testssl-results/{{ ip4_vip_dns2 }}_p853.csv" ] + - ["/usr/bin/git", "diff", "--quiet", "./../.github/workflow-fixtures/testssl-results/{{ ip4_vip_dns1 }}_p443.csv"] + - ["/usr/bin/git", "diff", "--quiet", "./../.github/workflow-fixtures/testssl-results/{{ ip4_vip_dns1 }}_p853.csv"] + - ["/usr/bin/git", "diff", "--quiet", "./../.github/workflow-fixtures/testssl-results/{{ ip4_vip_dns2 }}_p443.csv"] + - ["/usr/bin/git", "diff", "--quiet", "./../.github/workflow-fixtures/testssl-results/{{ ip4_vip_dns2 }}_p853.csv"] delegate_to: 127.0.0.1 when: ip4 == ip4_dns1 changed_when: false - command: + ansible.builtin.command: argv: "{{ item }}" diff --git a/requirements.yml b/requirements.yml deleted file mode 100644 index 2ad5ff2..0000000 --- a/requirements.yml +++ /dev/null @@ -1,4 +0,0 @@ ---- -collections: - - name: community.crypto - version: 2.26.8