diff --git a/.ansible-lint b/.ansible-lint index e008c8fbeb56f1793e1153f56a773ad0896a83e2..257647635a98c879bced2722ecf3782ae4835a95 100644 --- a/.ansible-lint +++ b/.ansible-lint @@ -42,6 +42,7 @@ use_default_rules: true skip_list: - skip_this_tag - git-latest + - name[casing] # Any rule that has the 'opt-in' tag will not be loaded unless its 'id' is # mentioned in the enable_list: diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 1751e61a0a4e56c24ab3100743227b5234474b27..aaf5bcc7cb856edd641ffae4290a278c17163b47 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,3 +1,4 @@ +--- # A pipeline is composed of independent jobs that run scripts, grouped into stages. # Stages run in sequential order, but jobs within stages run in parallel. # @@ -32,5 +33,5 @@ test-job: - molecule create --scenario-name default - molecule converge --scenario-name default - molecule idempotence --scenario-name default - #- molecule verify --scenario-name default + # - molecule verify --scenario-name default - molecule destroy --scenario-name default diff --git a/handlers/main.yml b/handlers/main.yml index db701ee0aaf53e6b673972fb283feefe03c24935..7b7b356ffbd50f84a428af571d682fd0f892bbda 100644 --- a/handlers/main.yml +++ b/handlers/main.yml @@ -8,17 +8,18 @@ mode: 0755 listen: "save iptables rules" -- name: install netfilter-persistent to be able to save iptables rules - ansible.builtin.apt: - name: "netfilter-persistent" - state: present - listen: "save iptables rules" - -- name: save iptables rules - ansible.builtin.command: 'netfilter-persistent save' - listen: "save iptables rules" - -- name: restart squid proxy - ansible.builtin.systemd: - name: "squid.service" - state: restarted +- name: persist changes in iptables configuration + block: + - name: install netfilter-persistent to be able to save iptables rules + ansible.builtin.apt: + name: "netfilter-persistent" + state: present + listen: "save iptables rules" + - name: save iptables rules + ansible.builtin.command: 'netfilter-persistent save' + changed_when: false + listen: "save iptables rules" + - name: restart squid proxy + ansible.builtin.systemd: + name: "squid.service" + state: restarted diff --git a/meta/main.yml b/meta/main.yml index 3513b054b8f6fb4042bd21c8fc1b4c2be1ec8ee6..0861c884bbc3a759bf5c18605c3b24a705df722d 100644 --- a/meta/main.yml +++ b/meta/main.yml @@ -1,17 +1,32 @@ --- galaxy_info: + role_name: ansible_lza_proxy + namespace: slub author: Jörg Sachse - description: role to install Squid caching proxy server for the SLUBarchiv digital preservation repository company: SLUB Dresden - namespace: slub - # If the issue tracker for your role is not on github, uncomment the next line and provide a value issue_tracker_url: http://example.com/issue/tracker Some suggested licenses: - BSD - # (default) - MIT - GPLv2 - GPLv3 - Apache - CC-BY - license: public domain - min_ansible_version: "2.4" + description: role to install Squid caching proxy server for the SLUBarchiv digital preservation repository + # galaxy_tags: [] + # List tags for your role here, one per line. A tag is a keyword that describes and categorizes the role. Users find roles by searching for tags. Be sure to remove the '[]' above, if you + # add tags to this list. + # + # NOTE: A tag is limited to a single word comprised of alphanumeric characters. + # Maximum 20 tags per role. + # issue_tracker_url: "https://example.com/" + # If the issue tracker for your role is not on github, uncomment the next line and provide a value issue_tracker_url: http://example.com/issue/tracker + + # Choose a valid license ID from https://spdx.org - some suggested licenses: + # - BSD-3-Clause (default) + # - MIT + # - GPL-2.0-or-later + # - GPL-3.0-only + # - Apache-2.0 + # - CC-BY-4.0 + license: GPL-3.0-or-later + + min_ansible_version: "2.5" # If this a Container Enabled role, provide the minimum Ansible Container version. min_ansible_container_version: Optionally specify the branch Galaxy will use when accessing the GitHub repo # for this role. During role install, if no tags are available, Galaxy will use this branch. During import Galaxy will access files on this branch. If Travis integration is configured, only # notifications for this branch will be accepted. Otherwise, in all cases, the repo's default branch (usually master) will be used. github_branch: - # # Provide a list of supported platforms, and for each platform a list of versions. If you don't wish to enumerate all versions for a particular platform, use 'all'. To view available # platforms and versions (or releases), visit: https://galaxy.ansible.com/api/v1/platforms/ # @@ -20,13 +35,10 @@ galaxy_info: platforms: - name: Debian versions: - - all - galaxy_tags: [] - # List tags for your role here, one per line. A tag is a keyword that describes and categorizes the role. Users find roles by searching for tags. Be sure to remove the '[]' above, if you - # add tags to this list. - # - # NOTE: A tag is limited to a single word comprised of alphanumeric characters. - # Maximum 20 tags per role. -dependencies: -# - ansible_lza_install_common -# - ansible_lza_server_hardening + - "bullseye" + - "bookworm" + - name: EL + versions: + - "7" + - "8" +dependencies: [] diff --git a/molecule/resources/playbooks/verify.yml b/molecule/resources/playbooks/verify.yml index 79044cd067d65d465136e1d68a529f32b58e0d38..d836443f28eb8e1e472e88bd8d05e0241308a9af 100644 --- a/molecule/resources/playbooks/verify.yml +++ b/molecule/resources/playbooks/verify.yml @@ -5,6 +5,6 @@ hosts: all gather_facts: false tasks: - - name: Example assertion - assert: - that: true + - name: Example assertion + assert: + that: true diff --git a/tasks/configure-iptables.yml b/tasks/configure-iptables.yml index 83b8706e9c57d25788c703c56002fc14e425d0b4..9ad3ca689ba24216aef7ea5dd09528dc4b4e8c41 100644 --- a/tasks/configure-iptables.yml +++ b/tasks/configure-iptables.yml @@ -15,7 +15,7 @@ source_port: "{{ item.src_port | default(omit) }}" state: "{{ item.state | default('present') }}" table: filter - loop: "{{ vault_iptables|flatten(levels=1) }}" + loop: "{{ vault_iptables | flatten(levels=1) }}" notify: - save iptables rules @@ -35,6 +35,6 @@ source_port: "{{ item.src_port | default(omit) }}" state: "{{ item.state | default('present') }}" table: filter - loop: "{{ vault_iptables|flatten(levels=1) }}" + loop: "{{ vault_iptables | flatten(levels=1) }}" notify: - save iptables rules diff --git a/tasks/configure-nfs-mounts.yml b/tasks/configure-nfs-mounts.yml index 650eccd8fa3a0770d42a41c18aa2d4fd7970d90f..7194ec2511bdf531a63c7ee345cf5abcc92cdc1e 100644 --- a/tasks/configure-nfs-mounts.yml +++ b/tasks/configure-nfs-mounts.yml @@ -9,7 +9,7 @@ mode: 0755 - name: NFS-Shares für Logging mounten - ansible.builtin.mount: + ansible.posix.mount: name: "{{ vault_nfs_mounts.log.mountpoint }}" src: "{{ vault_nfs_mounts.log.share }}/{{ ansible_hostname }}" state: mounted