Rename modules to use Ansible FQCNs (#500)

This commit is contained in:
Alessandro Fael Garcia 2022-03-23 12:59:02 +01:00
parent ff7ade6f4c
commit f40312c711
No known key found for this signature in database
GPG Key ID: 7E5B134EEDC42A56
14 changed files with 51 additions and 42 deletions

View File

@ -1,8 +1,8 @@
---
collections:
- name: community.general
version: 4.4.0
version: 4.6.1
- name: ansible.posix
version: 1.3.0
- name: community.docker
version: 2.1.1
version: 2.2.1

View File

@ -4,7 +4,12 @@
FEATURES:
Add Molecule testing infrastructure for RHEL 7/8.
* Add Molecule testing infrastructure for RHEL 7/8.
* Rename all modules to use the fully qualified collection name (FQCN) per Ansible guidelines.
ENHANCEMENTS:
Bump the Ansible `community.general` collection to `4.6.1` and `community.docker` collection to `2.2.1`.
BUG FIXES:

View File

@ -25,11 +25,11 @@ If you wish to install NGINX Plus using this role, you will need to obtain an NG
---
collections:
- name: community.general
version: 4.4.0
version: 4.6.1
- name: ansible.posix
version: 1.3.0
- name: community.docker # Only required if you plan to use Molecule (see below)
version: 2.1.1
version: 2.2.1
```
**Note:** You can alternatively install the Ansible community distribution (what is known as the "old" Ansible) if you don't want to manage individual collections.

View File

@ -47,3 +47,7 @@ galaxy_info:
- server
- development
- install
collections:
- ansible.posix
- community.general

View File

@ -1,6 +1,6 @@
---
- name: (Alpine Linux) Install logrotate
apk:
community.general.apk:
name: logrotate
when: ansible_facts['os_family'] == "Alpine"
@ -19,11 +19,11 @@
- name: (SLES) Set up logrotate
block:
- name: (SLES) Configure logrotate repository
zypper_repository:
community.general.zypper_repository:
repo: https://download.opensuse.org/repositories/openSUSE:Leap:42.1/standard/openSUSE:Leap:42.1.repo
- name: (SLES) Install Logrotate
zypper:
community.general.zypper:
name: logrotate
state: present
when: ansible_facts['os_family'] == "Suse"

View File

@ -8,7 +8,7 @@
when: nginx_manage_repo | bool
- name: (Alpine Linux) {{ nginx_setup | capitalize }} NGINX
apk:
community.general.apk:
name: "nginx{{ (nginx_repository is not defined and nginx_setup != 'uninstall') | ternary('@nginx', '') }}{{ nginx_version | default('') }}"
state: "{{ nginx_state }}"
update_cache: true

View File

@ -17,14 +17,14 @@
- name: (FreeBSD) {{ nginx_setup | capitalize }} NGINX
block:
- name: (FreeBSD) {{ nginx_setup | capitalize }} NGINX package
pkgng:
community.general.pkgng:
name: "www/nginx{{ nginx_version | default('') }}"
state: "{{ nginx_state }}"
when: nginx_bsd_install_packages | bool
notify: (Handler) Run NGINX
- name: (FreeBSD) {{ nginx_setup | capitalize }} NGINX port
portinstall:
community.general.portinstall:
name: "www/nginx{{ nginx_version | default('') }}"
use_packages: "{{ nginx_bsd_portinstall_use_packages | default(omit) }}"
state: "{{ nginx_state }}"
@ -35,7 +35,7 @@
- name: (OpenBSD) {{ nginx_setup | capitalize }} NGINX
block:
- name: (OpenBSD) {{ nginx_setup | capitalize }} NGINX package
openbsd_pkg:
community.general.openbsd_pkg:
name: "nginx{{ nginx_version | default('') }}"
build: false
state: "{{ nginx_state }}"
@ -43,7 +43,7 @@
notify: (Handler) Run NGINX
- name: (OpenBSD) {{ nginx_setup | capitalize }} NGINX port
openbsd_pkg:
community.general.openbsd_pkg:
name: "nginx{{ nginx_version | default('') }}"
build: true
state: "{{ nginx_state }}"

View File

@ -12,7 +12,7 @@
update_cache: true
- name: (RHEL 8) Set Python 3 as default
alternatives:
community.general.alternatives:
name: python
path: /usr/bin/python3
link: /usr/bin/python
@ -60,7 +60,7 @@
when: ansible_facts['os_family'] == "Debian"
- name: (Alpine Linux) Install build tools
apk:
community.general.apk:
name:
- alpine-sdk
- build-base
@ -118,7 +118,7 @@
- ansible_facts['os_family'] == "Debian"
- name: (Alpine Linux) Install PCRE dependency from package
apk:
community.general.apk:
name: pcre-dev
update_cache: true
when:
@ -148,11 +148,11 @@
creates: "/tmp/makefile"
- name: Make PCRE dependency
make:
community.general.make:
chdir: "/tmp/{{ pcre_version }}"
- name: Install PCRE dependency
make:
community.general.make:
chdir: "/tmp/{{ pcre_version }}"
target: install
when:
@ -177,7 +177,7 @@
- ansible_facts['os_family'] == "Debian"
- name: (Alpine Linux) Install ZLib dependency from package
apk:
community.general.apk:
name: zlib-dev
update_cache: true
when:
@ -207,11 +207,11 @@
creates: "/tmp/makefile"
- name: Make ZLib dependency
make:
community.general.make:
chdir: "/tmp/{{ zlib_version }}"
- name: Install ZLib dependency
make:
community.general.make:
chdir: "/tmp/{{ zlib_version }}"
target: install
when:
@ -236,7 +236,7 @@
- ansible_facts['os_family'] == "Debian"
- name: (Alpine Linux) Install OpenSSL dependency from package
apk:
community.general.apk:
name: openssl-dev
update_cache: true
when:
@ -266,11 +266,11 @@
creates: "/tmp/makefile"
- name: Make OpenSSL dependency
make:
community.general.make:
chdir: "/tmp/{{ openssl_version }}"
- name: Install OpenSSL dependency
make:
community.general.make:
chdir: "/tmp/{{ openssl_version }}"
target: install
when:
@ -344,11 +344,11 @@
register: nginx_configure
- name: Make NGINX
make:
community.general.make:
chdir: "/tmp/{{ nginx_version }}"
- name: Install NGINX
make:
community.general.make:
chdir: "/tmp/{{ nginx_version }}"
target: install

View File

@ -1,13 +1,13 @@
---
- name: (SLES) {{ (nginx_setup == 'uninstall') | ternary('Remove', 'Configure') }} NGINX repository
zypper_repository:
community.general.zypper_repository:
name: "nginx-{{ nginx_branch }}"
repo: "{{ nginx_repository | default(nginx_default_repository_suse) }}"
state: "{{ (nginx_state == 'uninstall') | ternary('absent', 'present') }}"
when: nginx_manage_repo | bool
- name: (SLES) {{ nginx_setup | capitalize }} NGINX
zypper:
community.general.zypper:
name: "nginx{{ nginx_version | default('') }}"
state: "{{ nginx_state }}"
disable_recommends: false

View File

@ -8,7 +8,7 @@
when: nginx_manage_repo | bool
- name: (Alpine Linux) {{ nginx_setup | capitalize }} NGINX Plus
apk:
community.general.apk:
name: "nginx-plus{{ nginx_version | default('') }}"
repository: "{{ nginx_repository | default(nginx_plus_default_repository_alpine) }}"
state: "{{ nginx_state }}"

View File

@ -23,7 +23,7 @@
when: nginx_manage_repo | bool
- name: (FreeBSD) {{ nginx_setup | capitalize }} NGINX Plus
pkgng:
community.general.pkgng:
name: "nginx-plus{{ nginx_version | default('') }}"
state: "{{ nginx_state }}"
when: nginx_license_status is not defined

View File

@ -1,13 +1,13 @@
---
- name: (SLES) {{ nginx_license_status is defined | ternary('Remove', 'Configure') }} NGINX Plus repository
zypper_repository:
community.general.zypper_repository:
name: nginx-plus
repo: "{{ nginx_repository | default(nginx_plus_default_repository_suse) }}"
state: "{{ nginx_license_status | default((nginx_setup == 'uninstall') | ternary('absent', 'present')) }}"
when: nginx_manage_repo | bool
- name: (SLES) {{ nginx_setup | capitalize }} NGINX Plus
zypper:
community.general.zypper:
name: "nginx-plus{{ nginx_version | default('') }}"
state: "{{ nginx_state }}"
update_cache: true

View File

@ -1,6 +1,6 @@
---
- name: (Alpine Linux) Install dependencies
apk:
community.general.apk:
name: "{{ nginx_alpine_dependencies }}"
update_cache: true
state: latest # noqa package-latest
@ -21,7 +21,7 @@
when: ansible_facts['os_family'] == "RedHat"
- name: (SLES) Install dependencies
zypper:
community.general.zypper:
name: "{{ nginx_sles_dependencies }}"
update_cache: true
state: latest # noqa package-latest
@ -30,13 +30,13 @@
- name: (FreeBSD) Install dependencies
block:
- name: (FreeBSD) Install dependencies using package(s)
pkgng:
community.general.pkgng:
name: "{{ nginx_freebsd_dependencies }}"
state: latest # noqa package-latest
when: nginx_bsd_install_packages | bool
- name: (FreeBSD) Install dependencies using port(s)
portinstall:
community.general.portinstall:
name: "{{ item }}"
use_packages: "{{ nginx_bsd_portinstall_use_packages | default(omit) }}"
state: latest # noqa package-latest

View File

@ -18,24 +18,24 @@
when: ansible_facts['os_family'] == "RedHat"
- name: Set SELinux mode to permissive
selinux:
ansible.builtin.selinux:
state: permissive
policy: targeted
- name: Allow SELinux HTTP network connections
seboolean:
ansible.builtin.seboolean:
name: httpd_can_network_connect
state: true
persistent: true
- name: Allow SELinux HTTP network connections
seboolean:
ansible.builtin.seboolean:
name: httpd_can_network_relay
state: true
persistent: true
- name: Allow SELinux TCP connections on specific ports
seport:
community.general.seport:
ports: "{{ nginx_selinux_tcp_ports }}"
proto: tcp
setype: http_port_t
@ -43,7 +43,7 @@
when: nginx_selinux_tcp_ports is defined
- name: Allow SELinux UDP connections on specific ports
seport:
community.general.seport:
ports: "{{ nginx_selinux_udp_ports }}"
proto: udp
setype: http_port_t
@ -75,7 +75,7 @@
when: nginx_selinux_module.changed | bool
- name: Set SELinux mode to enforcing
selinux:
ansible.builtin.selinux:
state: enforcing
policy: targeted
when: nginx_selinux_enforcing | bool