mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-03-21 20:59:10 +00:00
Integration tests: replace ansible_xxx with ansible_facts.xxx (#11479)
Replace ansible_xxx with ansible_facts.xxx.
This commit is contained in:
parent
106817316d
commit
476f2bf641
144 changed files with 548 additions and 578 deletions
|
|
@ -62,7 +62,7 @@
|
||||||
- block:
|
- block:
|
||||||
- include_tasks: remove_links.yml
|
- include_tasks: remove_links.yml
|
||||||
- include_tasks: tests_family.yml
|
- include_tasks: tests_family.yml
|
||||||
when: ansible_os_family == 'RedHat'
|
when: ansible_facts.os_family == 'RedHat'
|
||||||
|
|
||||||
# Cleanup
|
# Cleanup
|
||||||
always:
|
always:
|
||||||
|
|
@ -94,6 +94,6 @@
|
||||||
# *Disable tests on Alpine*
|
# *Disable tests on Alpine*
|
||||||
# TODO: figure out whether there is an alternatives tool for Alpine
|
# TODO: figure out whether there is an alternatives tool for Alpine
|
||||||
when:
|
when:
|
||||||
- ansible_distribution != 'Fedora' or ansible_distribution_major_version|int > 24
|
- ansible_facts.distribution != 'Fedora' or ansible_facts.distribution_major_version|int > 24
|
||||||
- ansible_distribution != 'Archlinux'
|
- ansible_facts.distribution != 'Archlinux'
|
||||||
- ansible_distribution != 'Alpine'
|
- ansible_facts.distribution != 'Alpine'
|
||||||
|
|
|
||||||
|
|
@ -6,8 +6,8 @@
|
||||||
- include_vars: '{{ item }}'
|
- include_vars: '{{ item }}'
|
||||||
with_first_found:
|
with_first_found:
|
||||||
- files:
|
- files:
|
||||||
- '{{ ansible_os_family }}-{{ ansible_distribution_version }}.yml'
|
- '{{ ansible_facts.os_family }}-{{ ansible_facts.distribution_version }}.yml'
|
||||||
- '{{ ansible_os_family }}.yml'
|
- '{{ ansible_facts.os_family }}.yml'
|
||||||
- default.yml
|
- default.yml
|
||||||
paths: ../vars
|
paths: ../vars
|
||||||
- template:
|
- template:
|
||||||
|
|
|
||||||
|
|
@ -9,8 +9,8 @@
|
||||||
owner: root
|
owner: root
|
||||||
group: root
|
group: root
|
||||||
mode: '0644'
|
mode: '0644'
|
||||||
when: with_alternatives or ansible_os_family != 'RedHat'
|
when: with_alternatives or ansible_facts.os_family != 'RedHat'
|
||||||
- file:
|
- file:
|
||||||
path: '{{ alternatives_dir }}/dummy'
|
path: '{{ alternatives_dir }}/dummy'
|
||||||
state: absent
|
state: absent
|
||||||
when: not with_alternatives and ansible_os_family == 'RedHat'
|
when: not with_alternatives and ansible_facts.os_family == 'RedHat'
|
||||||
|
|
|
||||||
|
|
@ -46,11 +46,11 @@
|
||||||
|
|
||||||
- name: 'check mode (manual: alternatives file existed, it has been updated)'
|
- name: 'check mode (manual: alternatives file existed, it has been updated)'
|
||||||
shell: 'head -n1 {{ alternatives_dir }}/dummy | grep "^manual$"'
|
shell: 'head -n1 {{ alternatives_dir }}/dummy | grep "^manual$"'
|
||||||
when: ansible_os_family != 'RedHat' or with_alternatives or item != 1
|
when: ansible_facts.os_family != 'RedHat' or with_alternatives or item != 1
|
||||||
|
|
||||||
- name: 'check mode (auto: alternatives file didn''t exist, it has been created)'
|
- name: 'check mode (auto: alternatives file didn''t exist, it has been created)'
|
||||||
shell: 'head -n1 {{ alternatives_dir }}/dummy | grep "^auto$"'
|
shell: 'head -n1 {{ alternatives_dir }}/dummy | grep "^auto$"'
|
||||||
when: ansible_os_family == 'RedHat' and not with_alternatives and item == 1
|
when: ansible_facts.os_family == 'RedHat' and not with_alternatives and item == 1
|
||||||
|
|
||||||
- name: check that alternative has been updated
|
- name: check that alternative has been updated
|
||||||
command: "grep -Pzq '/bin/dummy{{ item }}\\n' '{{ alternatives_dir }}/dummy'"
|
command: "grep -Pzq '/bin/dummy{{ item }}\\n' '{{ alternatives_dir }}/dummy'"
|
||||||
|
|
|
||||||
|
|
@ -17,4 +17,4 @@
|
||||||
mode: '{{ test_conf[2] }}'
|
mode: '{{ test_conf[2] }}'
|
||||||
# update-alternatives included in Fedora 26 (1.10) & Red Hat 7.4 (1.8) doesn't provide
|
# update-alternatives included in Fedora 26 (1.10) & Red Hat 7.4 (1.8) doesn't provide
|
||||||
# '--query' switch, 'link' is mandatory for these distributions.
|
# '--query' switch, 'link' is mandatory for these distributions.
|
||||||
when: ansible_os_family != 'RedHat' or test_conf[0]
|
when: ansible_facts.os_family != 'RedHat' or test_conf[0]
|
||||||
|
|
|
||||||
|
|
@ -11,21 +11,21 @@
|
||||||
# java >= 17 is not available in RHEL and CentOS7 repos, which is required for sdkmanager to run
|
# java >= 17 is not available in RHEL and CentOS7 repos, which is required for sdkmanager to run
|
||||||
- name: Bail out if not supported
|
- name: Bail out if not supported
|
||||||
when:
|
when:
|
||||||
- "ansible_os_family == 'RedHat' and ansible_distribution_version is version('8.0', '<')"
|
- "ansible_facts.os_family == 'RedHat' and ansible_facts.distribution_version is version('8.0', '<')"
|
||||||
ansible.builtin.meta: end_play
|
ansible.builtin.meta: end_play
|
||||||
|
|
||||||
- name: Run android_sdk tests
|
- name: Run android_sdk tests
|
||||||
environment:
|
environment:
|
||||||
PATH: '{{ ansible_env.PATH }}:{{ android_sdk_location }}/cmdline-tools/latest/bin'
|
PATH: '{{ ansible_facts.env.PATH }}:{{ android_sdk_location }}/cmdline-tools/latest/bin'
|
||||||
block:
|
block:
|
||||||
- import_tasks: setup.yml
|
- import_tasks: setup.yml
|
||||||
|
|
||||||
- name: Run default tests
|
- name: Run default tests
|
||||||
import_tasks: default-tests.yml
|
import_tasks: default-tests.yml
|
||||||
when: ansible_os_family != 'FreeBSD'
|
when: ansible_facts.os_family != 'FreeBSD'
|
||||||
|
|
||||||
# Most of the important Android SDK packages are not available on FreeBSD (like, build-tools, platform-tools and so on),
|
# Most of the important Android SDK packages are not available on FreeBSD (like, build-tools, platform-tools and so on),
|
||||||
# but at least some of the functionality can be tested (like, downloading sources)
|
# but at least some of the functionality can be tested (like, downloading sources)
|
||||||
- name: Run FreeBSD tests
|
- name: Run FreeBSD tests
|
||||||
import_tasks: freebsd-tests.yml
|
import_tasks: freebsd-tests.yml
|
||||||
when: ansible_os_family == 'FreeBSD'
|
when: ansible_facts.os_family == 'FreeBSD'
|
||||||
|
|
|
||||||
|
|
@ -13,10 +13,10 @@
|
||||||
vars:
|
vars:
|
||||||
params:
|
params:
|
||||||
files:
|
files:
|
||||||
- '{{ ansible_distribution }}-{{ ansible_distribution_version }}.yml'
|
- '{{ ansible_facts.distribution }}-{{ ansible_facts.distribution_version }}.yml'
|
||||||
- '{{ ansible_distribution }}-{{ ansible_distribution_major_version }}.yml'
|
- '{{ ansible_facts.distribution }}-{{ ansible_facts.distribution_major_version }}.yml'
|
||||||
- '{{ ansible_distribution }}.yml'
|
- '{{ ansible_facts.distribution }}.yml'
|
||||||
- '{{ ansible_os_family }}.yml'
|
- '{{ ansible_facts.os_family }}.yml'
|
||||||
paths:
|
paths:
|
||||||
- '{{ role_path }}/vars'
|
- '{{ role_path }}/vars'
|
||||||
|
|
||||||
|
|
@ -27,7 +27,7 @@
|
||||||
- "{{ openjdk_pkg }}"
|
- "{{ openjdk_pkg }}"
|
||||||
- unzip
|
- unzip
|
||||||
state: present
|
state: present
|
||||||
when: ansible_os_family != 'Darwin'
|
when: ansible_facts.os_family != 'Darwin'
|
||||||
|
|
||||||
- name: Install dependencies (OSX)
|
- name: Install dependencies (OSX)
|
||||||
block:
|
block:
|
||||||
|
|
@ -56,7 +56,7 @@
|
||||||
dest: "/Library/Java/JavaVirtualMachines/openjdk-17.jdk"
|
dest: "/Library/Java/JavaVirtualMachines/openjdk-17.jdk"
|
||||||
state: link
|
state: link
|
||||||
when:
|
when:
|
||||||
- ansible_os_family == 'Darwin'
|
- ansible_facts.os_family == 'Darwin'
|
||||||
|
|
||||||
- name: Create Android SDK directory
|
- name: Create Android SDK directory
|
||||||
file:
|
file:
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@
|
||||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
|
||||||
- meta: end_play
|
- meta: end_play
|
||||||
when: ansible_os_family not in ['Debian', 'Suse']
|
when: ansible_facts.os_family not in ['Debian', 'Suse']
|
||||||
|
|
||||||
- name: Enable mod_proxy
|
- name: Enable mod_proxy
|
||||||
community.general.apache2_module:
|
community.general.apache2_module:
|
||||||
|
|
@ -24,12 +24,12 @@
|
||||||
|
|
||||||
- name: Add port 81
|
- name: Add port 81
|
||||||
lineinfile:
|
lineinfile:
|
||||||
path: "/etc/apache2/{{ 'ports.conf' if ansible_os_family == 'Debian' else 'listen.conf' }}"
|
path: "/etc/apache2/{{ 'ports.conf' if ansible_facts.os_family == 'Debian' else 'listen.conf' }}"
|
||||||
line: Listen 81
|
line: Listen 81
|
||||||
|
|
||||||
- name: Set up virtual host
|
- name: Set up virtual host
|
||||||
copy:
|
copy:
|
||||||
dest: "/etc/apache2/{{ 'sites-available' if ansible_os_family == 'Debian' else 'vhosts.d' }}/000-apache2_mod_proxy-test.conf"
|
dest: "/etc/apache2/{{ 'sites-available' if ansible_facts.os_family == 'Debian' else 'vhosts.d' }}/000-apache2_mod_proxy-test.conf"
|
||||||
content: |
|
content: |
|
||||||
<VirtualHost *:81>
|
<VirtualHost *:81>
|
||||||
<Proxy balancer://mycluster>
|
<Proxy balancer://mycluster>
|
||||||
|
|
@ -62,7 +62,7 @@
|
||||||
owner: root
|
owner: root
|
||||||
group: root
|
group: root
|
||||||
state: link
|
state: link
|
||||||
when: ansible_os_family not in ['Suse']
|
when: ansible_facts.os_family not in ['Suse']
|
||||||
|
|
||||||
- name: Restart Apache
|
- name: Restart Apache
|
||||||
service:
|
service:
|
||||||
|
|
|
||||||
|
|
@ -65,7 +65,7 @@
|
||||||
state: present
|
state: present
|
||||||
|
|
||||||
- name: Debian/Ubuntu specific tests
|
- name: Debian/Ubuntu specific tests
|
||||||
when: "ansible_os_family == 'Debian'"
|
when: "ansible_facts.os_family == 'Debian'"
|
||||||
block:
|
block:
|
||||||
- name: force disable of autoindex # bug #2499
|
- name: force disable of autoindex # bug #2499
|
||||||
community.general.apache2_module:
|
community.general.apache2_module:
|
||||||
|
|
@ -89,7 +89,7 @@
|
||||||
name: evasive
|
name: evasive
|
||||||
state: present
|
state: present
|
||||||
# TODO: fix for Debian 13 (Trixie)!
|
# TODO: fix for Debian 13 (Trixie)!
|
||||||
when: ansible_distribution != 'Debian' or ansible_distribution_major_version is version('13', '<')
|
when: ansible_facts.distribution != 'Debian' or ansible_facts.distribution_major_version is version('13', '<')
|
||||||
|
|
||||||
- name: use identifier to enable module, fix for https://github.com/ansible/ansible/issues/33669
|
- name: use identifier to enable module, fix for https://github.com/ansible/ansible/issues/33669
|
||||||
community.general.apache2_module:
|
community.general.apache2_module:
|
||||||
|
|
|
||||||
|
|
@ -28,10 +28,10 @@
|
||||||
- name: ensure that all test modules are disabled again
|
- name: ensure that all test modules are disabled again
|
||||||
assert:
|
assert:
|
||||||
that: modules_before.stdout == modules_after.stdout
|
that: modules_before.stdout == modules_after.stdout
|
||||||
when: ansible_os_family in ['Debian', 'Suse']
|
when: ansible_facts.os_family in ['Debian', 'Suse']
|
||||||
# centos/RHEL does not have a2enmod/a2dismod
|
# centos/RHEL does not have a2enmod/a2dismod
|
||||||
|
|
||||||
- name: include misleading warning test
|
- name: include misleading warning test
|
||||||
include_tasks: 635-apache2-misleading-warning.yml
|
include_tasks: 635-apache2-misleading-warning.yml
|
||||||
when: ansible_os_family in ['Debian']
|
when: ansible_facts.os_family in ['Debian']
|
||||||
# Suse has mpm_event module compiled within the base apache2
|
# Suse has mpm_event module compiled within the base apache2
|
||||||
|
|
@ -7,7 +7,7 @@
|
||||||
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
|
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
|
||||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
- name: Run apk tests on Alpine
|
- name: Run apk tests on Alpine
|
||||||
when: ansible_distribution in ['Alpine']
|
when: ansible_facts.distribution in ['Alpine']
|
||||||
block:
|
block:
|
||||||
- name: Ensure vim is not installed
|
- name: Ensure vim is not installed
|
||||||
community.general.apk:
|
community.general.apk:
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@
|
||||||
cargo_environment:
|
cargo_environment:
|
||||||
# See https://github.com/rust-lang/cargo/issues/10230#issuecomment-1201662729:
|
# See https://github.com/rust-lang/cargo/issues/10230#issuecomment-1201662729:
|
||||||
CARGO_NET_GIT_FETCH_WITH_CLI: "true"
|
CARGO_NET_GIT_FETCH_WITH_CLI: "true"
|
||||||
when: has_cargo | default(false) and ansible_distribution == 'Alpine'
|
when: has_cargo | default(false) and ansible_facts.distribution == 'Alpine'
|
||||||
- block:
|
- block:
|
||||||
- import_tasks: test_general.yml
|
- import_tasks: test_general.yml
|
||||||
- import_tasks: test_version.yml
|
- import_tasks: test_version.yml
|
||||||
|
|
|
||||||
|
|
@ -11,11 +11,11 @@
|
||||||
- set_fact:
|
- set_fact:
|
||||||
has_cargo: true
|
has_cargo: true
|
||||||
when:
|
when:
|
||||||
- ansible_system != 'FreeBSD'
|
- ansible_facts.system != 'FreeBSD'
|
||||||
- ansible_distribution != 'MacOSX'
|
- ansible_facts.distribution != 'MacOSX'
|
||||||
- ansible_distribution != 'RedHat' or ansible_distribution_version is version('8.0', '>=')
|
- ansible_facts.distribution != 'RedHat' or ansible_facts.distribution_version is version('8.0', '>=')
|
||||||
- ansible_distribution != 'CentOS' or ansible_distribution_version is version('7.0', '>=')
|
- ansible_facts.distribution != 'CentOS' or ansible_facts.distribution_version is version('7.0', '>=')
|
||||||
- ansible_distribution != 'Ubuntu' or ansible_distribution_version is version('18', '>=')
|
- ansible_facts.distribution != 'Ubuntu' or ansible_facts.distribution_version is version('18', '>=')
|
||||||
|
|
||||||
- block:
|
- block:
|
||||||
- name: Install rust (containing cargo)
|
- name: Install rust (containing cargo)
|
||||||
|
|
@ -25,7 +25,7 @@
|
||||||
- set_fact:
|
- set_fact:
|
||||||
has_cargo: true
|
has_cargo: true
|
||||||
when:
|
when:
|
||||||
- ansible_system == 'FreeBSD' and ansible_distribution_version is version('13.0', '>')
|
- ansible_facts.system == 'FreeBSD' and ansible_facts.distribution_version is version('13.0', '>')
|
||||||
|
|
||||||
- block:
|
- block:
|
||||||
- name: Download rustup
|
- name: Download rustup
|
||||||
|
|
@ -39,4 +39,4 @@
|
||||||
- set_fact:
|
- set_fact:
|
||||||
rustup_cargo_bin: "{{ lookup('env', 'HOME') }}/.cargo/bin/cargo"
|
rustup_cargo_bin: "{{ lookup('env', 'HOME') }}/.cargo/bin/cargo"
|
||||||
when:
|
when:
|
||||||
- ansible_distribution != 'CentOS' or ansible_distribution_version is version('7.0', '>=')
|
- ansible_facts.distribution != 'CentOS' or ansible_facts.distribution_version is version('7.0', '>=')
|
||||||
|
|
|
||||||
|
|
@ -11,10 +11,10 @@
|
||||||
- name: Help debugging
|
- name: Help debugging
|
||||||
debug:
|
debug:
|
||||||
msg: >-
|
msg: >-
|
||||||
distribution={{ ansible_distribution }},
|
distribution={{ ansible_facts.distribution }},
|
||||||
distribution major version={{ ansible_distribution_major_version }},
|
distribution major version={{ ansible_facts.distribution_major_version }},
|
||||||
os_family={{ ansible_os_family }},
|
os_family={{ ansible_facts.os_family }},
|
||||||
Python version={{ ansible_python.version.major }}
|
Python version={{ ansible_facts.python.version.major }}
|
||||||
|
|
||||||
- name: test cloud-init
|
- name: test cloud-init
|
||||||
# TODO: check for a workaround
|
# TODO: check for a workaround
|
||||||
|
|
@ -23,13 +23,13 @@
|
||||||
# /etc/init/ureadahead.conf to /etc/init/ureadahead.conf.distrib
|
# /etc/init/ureadahead.conf to /etc/init/ureadahead.conf.distrib
|
||||||
# https://bugs.launchpad.net/ubuntu/+source/ureadahead/+bug/997838
|
# https://bugs.launchpad.net/ubuntu/+source/ureadahead/+bug/997838
|
||||||
when:
|
when:
|
||||||
- not (ansible_distribution == "Ubuntu" and ansible_distribution_major_version|int == 14)
|
- not (ansible_facts.distribution == "Ubuntu" and ansible_facts.distribution_major_version|int == 14)
|
||||||
- not (ansible_os_family == "Suse" and ansible_distribution_major_version|int == 15)
|
- not (ansible_facts.os_family == "Suse" and ansible_facts.distribution_major_version|int == 15)
|
||||||
- not (ansible_distribution == "CentOS" and ansible_distribution_major_version|int == 8) # TODO: cannot start service
|
- not (ansible_facts.distribution == "CentOS" and ansible_facts.distribution_major_version|int == 8) # TODO: cannot start service
|
||||||
- not (ansible_distribution == 'Archlinux') # TODO: package seems to be broken, cannot be downloaded from mirrors?
|
- not (ansible_facts.distribution == 'Archlinux') # TODO: package seems to be broken, cannot be downloaded from mirrors?
|
||||||
- not (ansible_distribution == 'Alpine') # TODO: not sure what's wrong here, the module doesn't return what the tests expect
|
- not (ansible_facts.distribution == 'Alpine') # TODO: not sure what's wrong here, the module doesn't return what the tests expect
|
||||||
- not (ansible_distribution == 'Debian' and ansible_distribution_major_version|int == 13) # TODO: not sure what's wrong here, the module doesn't return what the tests expect
|
- not (ansible_facts.distribution == 'Debian' and ansible_facts.distribution_major_version|int == 13) # TODO: not sure what's wrong here, the module doesn't return what the tests expect
|
||||||
- not (ansible_distribution == 'Fedora' and ansible_distribution_major_version|int == 43) # TODO: not sure what's wrong here, the module doesn't return what the tests expect
|
- not (ansible_facts.distribution == 'Fedora' and ansible_facts.distribution_major_version|int == 43) # TODO: not sure what's wrong here, the module doesn't return what the tests expect
|
||||||
block:
|
block:
|
||||||
- name: setup install cloud-init
|
- name: setup install cloud-init
|
||||||
package:
|
package:
|
||||||
|
|
@ -41,7 +41,7 @@
|
||||||
user:
|
user:
|
||||||
name: systemd-network
|
name: systemd-network
|
||||||
state: present
|
state: present
|
||||||
when: ansible_distribution == 'Fedora' and ansible_distribution_major_version|int >= 37
|
when: ansible_facts.distribution == 'Fedora' and ansible_facts.distribution_major_version|int >= 37
|
||||||
|
|
||||||
- name: setup run cloud-init
|
- name: setup run cloud-init
|
||||||
service:
|
service:
|
||||||
|
|
|
||||||
|
|
@ -171,8 +171,8 @@ cmd_echo_tests:
|
||||||
- name: use cmd {{ remote_tmp_dir }}/echo
|
- name: use cmd {{ remote_tmp_dir }}/echo
|
||||||
condition: >
|
condition: >
|
||||||
{{
|
{{
|
||||||
ansible_distribution != "MacOSX" and
|
ansible_facts.distribution != "MacOSX" and
|
||||||
not (ansible_distribution == "CentOS" and ansible_distribution_major_version is version('7.0', '<'))
|
not (ansible_facts.distribution == "CentOS" and ansible_facts.distribution_major_version is version('7.0', '<'))
|
||||||
}}
|
}}
|
||||||
copy_to: "{{ remote_tmp_dir }}"
|
copy_to: "{{ remote_tmp_dir }}"
|
||||||
cmd: "{{ remote_tmp_dir }}/echo"
|
cmd: "{{ remote_tmp_dir }}/echo"
|
||||||
|
|
@ -196,8 +196,8 @@ cmd_echo_tests:
|
||||||
cmd: echo
|
cmd: echo
|
||||||
condition: >
|
condition: >
|
||||||
{{
|
{{
|
||||||
ansible_distribution != "MacOSX" and
|
ansible_facts.distribution != "MacOSX" and
|
||||||
not (ansible_distribution == "CentOS" and ansible_distribution_major_version is version('7.0', '<'))
|
not (ansible_facts.distribution == "CentOS" and ansible_facts.distribution_major_version is version('7.0', '<'))
|
||||||
}}
|
}}
|
||||||
copy_to: "{{ remote_tmp_dir }}"
|
copy_to: "{{ remote_tmp_dir }}"
|
||||||
path_prefix: "{{ remote_tmp_dir }}"
|
path_prefix: "{{ remote_tmp_dir }}"
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@
|
||||||
- name: Install Consul and test
|
- name: Install Consul and test
|
||||||
vars:
|
vars:
|
||||||
consul_version: 1.13.2
|
consul_version: 1.13.2
|
||||||
consul_uri: https://releases.hashicorp.com/consul/{{ consul_version }}/consul_{{ consul_version }}_{{ ansible_system | lower }}_{{ consul_arch }}.zip
|
consul_uri: https://releases.hashicorp.com/consul/{{ consul_version }}/consul_{{ consul_version }}_{{ ansible_facts.system | lower }}_{{ consul_arch }}.zip
|
||||||
consul_cmd: '{{ remote_tmp_dir }}/consul'
|
consul_cmd: '{{ remote_tmp_dir }}/consul'
|
||||||
block:
|
block:
|
||||||
- name: Install requests<2.20 (CentOS/RHEL 6)
|
- name: Install requests<2.20 (CentOS/RHEL 6)
|
||||||
|
|
@ -20,7 +20,7 @@
|
||||||
extra_args: "-c {{ remote_constraints }}"
|
extra_args: "-c {{ remote_constraints }}"
|
||||||
register: result
|
register: result
|
||||||
until: result is success
|
until: result is success
|
||||||
when: ansible_distribution_file_variety|default() == 'RedHat' and ansible_distribution_major_version is version('6', '<=')
|
when: ansible_facts.distribution_file_variety|default() == 'RedHat' and ansible_facts.distribution_major_version is version('6', '<=')
|
||||||
- name: Install py-consul
|
- name: Install py-consul
|
||||||
pip:
|
pip:
|
||||||
name: py-consul
|
name: py-consul
|
||||||
|
|
@ -51,15 +51,15 @@
|
||||||
name: unzip
|
name: unzip
|
||||||
register: result
|
register: result
|
||||||
until: result is success
|
until: result is success
|
||||||
when: ansible_distribution != "MacOSX"
|
when: ansible_facts.distribution != "MacOSX"
|
||||||
- assert:
|
- assert:
|
||||||
that: ansible_architecture in ['i386', 'x86_64', 'amd64']
|
that: ansible_facts.architecture in ['i386', 'x86_64', 'amd64']
|
||||||
- set_fact:
|
- set_fact:
|
||||||
consul_arch: '386'
|
consul_arch: '386'
|
||||||
when: ansible_architecture == 'i386'
|
when: ansible_facts.architecture == 'i386'
|
||||||
- set_fact:
|
- set_fact:
|
||||||
consul_arch: amd64
|
consul_arch: amd64
|
||||||
when: ansible_architecture in ['x86_64', 'amd64']
|
when: ansible_facts.architecture in ['x86_64', 'amd64']
|
||||||
- name: Download consul binary
|
- name: Download consul binary
|
||||||
unarchive:
|
unarchive:
|
||||||
src: '{{ consul_uri }}'
|
src: '{{ consul_uri }}'
|
||||||
|
|
|
||||||
|
|
@ -7,9 +7,9 @@
|
||||||
# Fedora or RHEL >= 8
|
# Fedora or RHEL >= 8
|
||||||
# This module requires the dnf module which is not available on RHEL 7.
|
# This module requires the dnf module which is not available on RHEL 7.
|
||||||
- >
|
- >
|
||||||
ansible_distribution == 'Fedora'
|
ansible_facts.distribution == 'Fedora'
|
||||||
or (ansible_os_family == 'RedHat' and ansible_distribution != 'Fedora'
|
or (ansible_facts.os_family == 'RedHat' and ansible_facts.distribution != 'Fedora'
|
||||||
and ansible_distribution_major_version | int >= 8)
|
and ansible_facts.distribution_major_version | int >= 8)
|
||||||
block:
|
block:
|
||||||
- debug: var=copr_chroot
|
- debug: var=copr_chroot
|
||||||
- name: enable copr project
|
- name: enable copr project
|
||||||
|
|
@ -66,8 +66,8 @@
|
||||||
when:
|
when:
|
||||||
# Copr does not build new packages for EOL Fedoras.
|
# Copr does not build new packages for EOL Fedoras.
|
||||||
- >
|
- >
|
||||||
not (ansible_distribution == 'Fedora' and
|
not (ansible_facts.distribution == 'Fedora' and
|
||||||
ansible_distribution_major_version | int < 35)
|
ansible_facts.distribution_major_version | int < 35)
|
||||||
block:
|
block:
|
||||||
- name: install test package from the copr
|
- name: install test package from the copr
|
||||||
ansible.builtin.package:
|
ansible.builtin.package:
|
||||||
|
|
|
||||||
|
|
@ -11,5 +11,5 @@ copr_repofile: '/etc/yum.repos.d/_copr:{{ copr_host }}:{{ copr_namespace }}:{{ c
|
||||||
|
|
||||||
# TODO: Fix chroot autodetection so this isn't necessary
|
# TODO: Fix chroot autodetection so this isn't necessary
|
||||||
_copr_chroot_fedora: "fedora-rawhide-x86_64"
|
_copr_chroot_fedora: "fedora-rawhide-x86_64"
|
||||||
_copr_chroot_rhelish: "epel-{{ ansible_distribution_major_version }}-x86_64"
|
_copr_chroot_rhelish: "epel-{{ ansible_facts.distribution_major_version }}-x86_64"
|
||||||
copr_chroot: "{{ _copr_chroot_fedora if ansible_distribution == 'Fedora' else _copr_chroot_rhelish }}"
|
copr_chroot: "{{ _copr_chroot_fedora if ansible_facts.distribution == 'Fedora' else _copr_chroot_rhelish }}"
|
||||||
|
|
|
||||||
|
|
@ -6,9 +6,9 @@
|
||||||
- name: bail out for non-supported platforms
|
- name: bail out for non-supported platforms
|
||||||
meta: end_play
|
meta: end_play
|
||||||
when:
|
when:
|
||||||
- (ansible_os_family != "RedHat" or ansible_distribution_major_version|int < 8) # TODO: bump back to 7
|
- (ansible_facts.os_family != "RedHat" or ansible_facts.distribution_major_version|int < 8) # TODO: bump back to 7
|
||||||
- (ansible_distribution != 'CentOS' or ansible_distribution_major_version|int < 8) # TODO: remove
|
- (ansible_facts.distribution != 'CentOS' or ansible_facts.distribution_major_version|int < 8) # TODO: remove
|
||||||
- ansible_os_family != "Debian"
|
- ansible_facts.os_family != "Debian"
|
||||||
|
|
||||||
- name: install perl development package for Red Hat family
|
- name: install perl development package for Red Hat family
|
||||||
package:
|
package:
|
||||||
|
|
@ -17,7 +17,7 @@
|
||||||
- perl-App-cpanminus
|
- perl-App-cpanminus
|
||||||
state: present
|
state: present
|
||||||
become: true
|
become: true
|
||||||
when: ansible_os_family == "RedHat"
|
when: ansible_facts.os_family == "RedHat"
|
||||||
|
|
||||||
- name: install perl development package for Debian family
|
- name: install perl development package for Debian family
|
||||||
package:
|
package:
|
||||||
|
|
@ -25,7 +25,7 @@
|
||||||
- cpanminus
|
- cpanminus
|
||||||
state: present
|
state: present
|
||||||
become: true
|
become: true
|
||||||
when: ansible_os_family == "Debian"
|
when: ansible_facts.os_family == "Debian"
|
||||||
|
|
||||||
- name: install a Perl package
|
- name: install a Perl package
|
||||||
cpanm:
|
cpanm:
|
||||||
|
|
|
||||||
|
|
@ -27,15 +27,15 @@
|
||||||
- bzip2
|
- bzip2
|
||||||
state: latest
|
state: latest
|
||||||
when:
|
when:
|
||||||
- ansible_system != 'FreeBSD'
|
- ansible_facts.system != 'FreeBSD'
|
||||||
- ansible_os_family != 'Darwin'
|
- ansible_facts.os_family != 'Darwin'
|
||||||
- ansible_os_family != 'Debian'
|
- ansible_facts.os_family != 'Debian'
|
||||||
|
|
||||||
- name: Ensure xz is present to create compressed files (Debian)
|
- name: Ensure xz is present to create compressed files (Debian)
|
||||||
package:
|
package:
|
||||||
name: xz-utils
|
name: xz-utils
|
||||||
state: latest
|
state: latest
|
||||||
when: ansible_os_family == 'Debian'
|
when: ansible_facts.os_family == 'Debian'
|
||||||
|
|
||||||
- name: Ensure xz is present to create compressed file (macOS)
|
- name: Ensure xz is present to create compressed file (macOS)
|
||||||
block:
|
block:
|
||||||
|
|
@ -58,7 +58,7 @@
|
||||||
environment:
|
environment:
|
||||||
HOMEBREW_NO_AUTO_UPDATE: "True"
|
HOMEBREW_NO_AUTO_UPDATE: "True"
|
||||||
when:
|
when:
|
||||||
- ansible_os_family == 'Darwin'
|
- ansible_facts.os_family == 'Darwin'
|
||||||
|
|
||||||
- name: Generate compressed files
|
- name: Generate compressed files
|
||||||
shell: |
|
shell: |
|
||||||
|
|
|
||||||
|
|
@ -42,7 +42,7 @@
|
||||||
value: 1
|
value: 1
|
||||||
- name: "Field 2"
|
- name: "Field 2"
|
||||||
value: "Text"
|
value: "Text"
|
||||||
timestamp: "{{ ansible_date_time.iso8601 }}"
|
timestamp: "{{ ansible_facts.date_time.iso8601 }}"
|
||||||
username: Ansible Test
|
username: Ansible Test
|
||||||
avatar_url: "https://avatars.githubusercontent.com/u/44586252?s=200&v=4"
|
avatar_url: "https://avatars.githubusercontent.com/u/44586252?s=200&v=4"
|
||||||
register: result
|
register: result
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,6 @@
|
||||||
- include_tasks: install.yml
|
- include_tasks: install.yml
|
||||||
- include_tasks: lock_bash.yml
|
- include_tasks: lock_bash.yml
|
||||||
- include_tasks: lock_updates.yml
|
- include_tasks: lock_updates.yml
|
||||||
when: (ansible_distribution == 'Fedora' and ansible_distribution_major_version is version('23', '>=')) or
|
when: (ansible_facts.distribution == 'Fedora' and ansible_facts.distribution_major_version is version('23', '>=')) or
|
||||||
(ansible_distribution in ['RedHat', 'CentOS'] and ansible_distribution_major_version is version('8', '>='))
|
(ansible_facts.distribution in ['RedHat', 'CentOS'] and ansible_facts.distribution_major_version is version('8', '>='))
|
||||||
...
|
...
|
||||||
|
|
|
||||||
|
|
@ -10,4 +10,4 @@
|
||||||
|
|
||||||
- name: "include tasks for Debian family"
|
- name: "include tasks for Debian family"
|
||||||
include_tasks: prepare.yml
|
include_tasks: prepare.yml
|
||||||
when: ansible_pkg_mgr == "apt"
|
when: ansible_facts.pkg_mgr == "apt"
|
||||||
|
|
|
||||||
|
|
@ -14,9 +14,9 @@
|
||||||
# TODO: remove Ubuntu 24.04 (noble) from the list
|
# TODO: remove Ubuntu 24.04 (noble) from the list
|
||||||
# TODO: remove Debian 13 (Trixie) from the list
|
# TODO: remove Debian 13 (Trixie) from the list
|
||||||
when: >
|
when: >
|
||||||
ansible_distribution in ('Alpine', 'openSUSE Leap', 'CentOS', 'Fedora', 'Archlinux')
|
ansible_facts.distribution in ('Alpine', 'openSUSE Leap', 'CentOS', 'Fedora', 'Archlinux')
|
||||||
or (ansible_distribution == 'Ubuntu' and ansible_distribution_release in ['noble'])
|
or (ansible_facts.distribution == 'Ubuntu' and ansible_facts.distribution_release in ['noble'])
|
||||||
or (ansible_distribution == 'Debian' and ansible_distribution_major_version == '13')
|
or (ansible_facts.distribution == 'Debian' and ansible_facts.distribution_major_version == '13')
|
||||||
|
|
||||||
- name: Remove ejabberd
|
- name: Remove ejabberd
|
||||||
ansible.builtin.package:
|
ansible.builtin.package:
|
||||||
|
|
@ -47,12 +47,12 @@
|
||||||
loop:
|
loop:
|
||||||
- PrivateDevices
|
- PrivateDevices
|
||||||
- AmbientCapabilities
|
- AmbientCapabilities
|
||||||
when: ansible_distribution == 'Archlinux'
|
when: ansible_facts.distribution == 'Archlinux'
|
||||||
|
|
||||||
- name: Make installable on Arch
|
- name: Make installable on Arch
|
||||||
systemd:
|
systemd:
|
||||||
daemon_reload: true
|
daemon_reload: true
|
||||||
when: ansible_distribution == 'Archlinux'
|
when: ansible_facts.distribution == 'Archlinux'
|
||||||
|
|
||||||
- ansible.builtin.service:
|
- ansible.builtin.service:
|
||||||
name: ejabberd
|
name: ejabberd
|
||||||
|
|
|
||||||
|
|
@ -15,4 +15,4 @@
|
||||||
- name: run_tests for supported distros
|
- name: run_tests for supported distros
|
||||||
include_tasks: run_tests.yml
|
include_tasks: run_tests.yml
|
||||||
when:
|
when:
|
||||||
- ansible_distribution | lower ~ "-" ~ ansible_distribution_major_version | lower != 'centos-6'
|
- ansible_facts.distribution | lower ~ "-" ~ ansible_facts.distribution_major_version | lower != 'centos-6'
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,7 @@
|
||||||
- name: Include tasks to test playing with sparse files
|
- name: Include tasks to test playing with sparse files
|
||||||
include_tasks: sparse.yml
|
include_tasks: sparse.yml
|
||||||
when:
|
when:
|
||||||
- not (ansible_os_family == 'Darwin' and ansible_distribution_version is version('11', '<'))
|
- not (ansible_facts.os_family == 'Darwin' and ansible_facts.distribution_version is version('11', '<'))
|
||||||
|
|
||||||
- name: Include tasks to test playing with symlinks
|
- name: Include tasks to test playing with symlinks
|
||||||
include_tasks: symlinks.yml
|
include_tasks: symlinks.yml
|
||||||
|
|
|
||||||
|
|
@ -55,7 +55,7 @@
|
||||||
|
|
||||||
- name: "Assert that filesystem UUID is changed"
|
- name: "Assert that filesystem UUID is changed"
|
||||||
# libblkid gets no UUID at all for this fstype on FreeBSD
|
# libblkid gets no UUID at all for this fstype on FreeBSD
|
||||||
when: not (ansible_system == 'FreeBSD' and fstype == 'reiserfs')
|
when: not (ansible_facts.system == 'FreeBSD' and fstype == 'reiserfs')
|
||||||
ansible.builtin.assert:
|
ansible.builtin.assert:
|
||||||
that:
|
that:
|
||||||
- 'fs3_result is changed'
|
- 'fs3_result is changed'
|
||||||
|
|
@ -102,8 +102,8 @@
|
||||||
|
|
||||||
- when:
|
- when:
|
||||||
- (grow | bool and (fstype != "vfat" or resize_vfat)) or
|
- (grow | bool and (fstype != "vfat" or resize_vfat)) or
|
||||||
(fstype == "xfs" and ansible_system == "Linux" and
|
(fstype == "xfs" and ansible_facts.system == "Linux" and
|
||||||
ansible_distribution not in ["CentOS", "Ubuntu"])
|
ansible_facts.distribution not in ["CentOS", "Ubuntu"])
|
||||||
block:
|
block:
|
||||||
- name: "Check that resizefs does nothing if device size is not changed"
|
- name: "Check that resizefs does nothing if device size is not changed"
|
||||||
community.general.filesystem:
|
community.general.filesystem:
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@
|
||||||
vars:
|
vars:
|
||||||
search:
|
search:
|
||||||
files:
|
files:
|
||||||
- '{{ ansible_distribution }}-{{ ansible_distribution_version }}.yml'
|
- '{{ ansible_facts.distribution }}-{{ ansible_facts.distribution_version }}.yml'
|
||||||
- 'default.yml'
|
- 'default.yml'
|
||||||
paths:
|
paths:
|
||||||
- '../vars/'
|
- '../vars/'
|
||||||
|
|
@ -36,54 +36,54 @@
|
||||||
# Not available: btrfs, lvm, f2fs, ocfs2
|
# Not available: btrfs, lvm, f2fs, ocfs2
|
||||||
# All BSD systems use swap fs, but only Linux needs mkswap
|
# All BSD systems use swap fs, but only Linux needs mkswap
|
||||||
# Supported: ext2/3/4 (e2fsprogs), xfs (xfsprogs), reiserfs (progsreiserfs), vfat
|
# Supported: ext2/3/4 (e2fsprogs), xfs (xfsprogs), reiserfs (progsreiserfs), vfat
|
||||||
- 'not (ansible_system == "FreeBSD" and item.0.key in ["bcachefs", "btrfs", "f2fs", "swap", "lvm", "ocfs2"])'
|
- 'not (ansible_facts.system == "FreeBSD" and item.0.key in ["bcachefs", "btrfs", "f2fs", "swap", "lvm", "ocfs2"])'
|
||||||
# Available on FreeBSD but not on testbed (util-linux conflicts with e2fsprogs): wipefs, mkfs.minix
|
# Available on FreeBSD but not on testbed (util-linux conflicts with e2fsprogs): wipefs, mkfs.minix
|
||||||
- 'not (ansible_system == "FreeBSD" and item.1 in ["overwrite_another_fs", "remove_fs"])'
|
- 'not (ansible_facts.system == "FreeBSD" and item.1 in ["overwrite_another_fs", "remove_fs"])'
|
||||||
|
|
||||||
# Linux limited support
|
# Linux limited support
|
||||||
# Not available: ufs (this is FreeBSD's native fs)
|
# Not available: ufs (this is FreeBSD's native fs)
|
||||||
- 'not (ansible_system == "Linux" and item.0.key == "ufs")'
|
- 'not (ansible_facts.system == "Linux" and item.0.key == "ufs")'
|
||||||
|
|
||||||
# Other limitations and corner cases
|
# Other limitations and corner cases
|
||||||
|
|
||||||
# bcachefs only on Alpine > 3.18 and Arch Linux for now
|
# bcachefs only on Alpine > 3.18 and Arch Linux for now
|
||||||
# other distributions have too old versions of bcachefs-tools and/or util-linux (blkid for UUID tests)
|
# other distributions have too old versions of bcachefs-tools and/or util-linux (blkid for UUID tests)
|
||||||
- 'ansible_distribution == "Alpine" and ansible_distribution_version is version("3.18", ">") and item.0.key == "bcachefs"'
|
- 'ansible_facts.distribution == "Alpine" and ansible_facts.distribution_version is version("3.18", ">") and item.0.key == "bcachefs"'
|
||||||
- 'ansible_distribution == "Archlinux" and item.0.key == "bcachefs"'
|
- 'ansible_facts.distribution == "Archlinux" and item.0.key == "bcachefs"'
|
||||||
# f2fs-tools and reiserfs-utils packages not available with RHEL/CentOS on CI
|
# f2fs-tools and reiserfs-utils packages not available with RHEL/CentOS on CI
|
||||||
- 'not (ansible_distribution in ["CentOS", "RedHat"] and item.0.key in ["f2fs", "reiserfs"])'
|
- 'not (ansible_facts.distribution in ["CentOS", "RedHat"] and item.0.key in ["f2fs", "reiserfs"])'
|
||||||
- 'not (ansible_os_family == "RedHat" and ansible_distribution_major_version is version("8", ">=") and
|
- 'not (ansible_facts.os_family == "RedHat" and ansible_facts.distribution_major_version is version("8", ">=") and
|
||||||
item.0.key == "btrfs")'
|
item.0.key == "btrfs")'
|
||||||
# reiserfs-utils package not available with Fedora 35 on CI
|
# reiserfs-utils package not available with Fedora 35 on CI
|
||||||
- 'not (ansible_distribution == "Fedora" and (ansible_facts.distribution_major_version | int >= 35) and
|
- 'not (ansible_facts.distribution == "Fedora" and (ansible_facts.distribution_major_version | int >= 35) and
|
||||||
item.0.key == "reiserfs")'
|
item.0.key == "reiserfs")'
|
||||||
# reiserfs packages apparently not available with Alpine
|
# reiserfs packages apparently not available with Alpine
|
||||||
- 'not (ansible_distribution == "Alpine" and item.0.key == "reiserfs")'
|
- 'not (ansible_facts.distribution == "Alpine" and item.0.key == "reiserfs")'
|
||||||
# reiserfsprogs packages no longer available with Arch Linux
|
# reiserfsprogs packages no longer available with Arch Linux
|
||||||
- 'not (ansible_distribution == "Archlinux" and item.0.key == "reiserfs")'
|
- 'not (ansible_facts.distribution == "Archlinux" and item.0.key == "reiserfs")'
|
||||||
# ocfs2 only available on Debian based distributions
|
# ocfs2 only available on Debian based distributions
|
||||||
- 'not (item.0.key == "ocfs2" and ansible_os_family != "Debian")'
|
- 'not (item.0.key == "ocfs2" and ansible_facts.os_family != "Debian")'
|
||||||
# Tests use losetup which can not be used inside unprivileged container
|
# Tests use losetup which can not be used inside unprivileged container
|
||||||
- 'not (item.0.key == "lvm" and ansible_virtualization_type in ["docker", "container", "containerd"])'
|
- 'not (item.0.key == "lvm" and ansible_facts.virtualization_type in ["docker", "container", "containerd"])'
|
||||||
# vfat resizing fails on Debian (but not Ubuntu)
|
# vfat resizing fails on Debian (but not Ubuntu)
|
||||||
- 'not (item.0.key == "vfat" and ansible_distribution == "Debian")' # TODO: figure out why it fails, fix it!
|
- 'not (item.0.key == "vfat" and ansible_facts.distribution == "Debian")' # TODO: figure out why it fails, fix it!
|
||||||
# vfat resizing fails on ArchLinux
|
# vfat resizing fails on ArchLinux
|
||||||
- 'not (item.0.key == "vfat" and ansible_distribution == "Archlinux")' # TODO: figure out why it fails, fix it!
|
- 'not (item.0.key == "vfat" and ansible_facts.distribution == "Archlinux")' # TODO: figure out why it fails, fix it!
|
||||||
# vfat resizing fails on Ubuntu 22.04
|
# vfat resizing fails on Ubuntu 22.04
|
||||||
- 'not (item.0.key == "vfat" and ansible_distribution == "Ubuntu" and (ansible_facts.distribution_major_version | int == 22))'
|
- 'not (item.0.key == "vfat" and ansible_facts.distribution == "Ubuntu" and (ansible_facts.distribution_major_version | int == 22))'
|
||||||
# TODO: figure out why it fails, fix it!
|
# TODO: figure out why it fails, fix it!
|
||||||
# btrfs-progs cannot be installed on ArchLinux
|
# btrfs-progs cannot be installed on ArchLinux
|
||||||
- 'not (item.0.key == "btrfs" and ansible_distribution == "Archlinux")' # TODO: figure out why it fails, fix it!
|
- 'not (item.0.key == "btrfs" and ansible_facts.distribution == "Archlinux")' # TODO: figure out why it fails, fix it!
|
||||||
|
|
||||||
# On CentOS 6 shippable containers, wipefs seems unable to remove vfat signatures
|
# On CentOS 6 shippable containers, wipefs seems unable to remove vfat signatures
|
||||||
- 'not (ansible_distribution == "CentOS" and ansible_distribution_version is version("7.0", "<") and
|
- 'not (ansible_facts.distribution == "CentOS" and ansible_facts.distribution_version is version("7.0", "<") and
|
||||||
item.1 == "remove_fs" and item.0.key == "vfat")'
|
item.1 == "remove_fs" and item.0.key == "vfat")'
|
||||||
# On same systems, mkfs.minix (unhandled by the module) can't find the device/file
|
# On same systems, mkfs.minix (unhandled by the module) can't find the device/file
|
||||||
- 'not (ansible_distribution == "CentOS" and ansible_distribution_version is version("7.0", "<") and
|
- 'not (ansible_facts.distribution == "CentOS" and ansible_facts.distribution_version is version("7.0", "<") and
|
||||||
item.1 == "overwrite_another_fs")'
|
item.1 == "overwrite_another_fs")'
|
||||||
|
|
||||||
# TODO: something seems to be broken on Alpine
|
# TODO: something seems to be broken on Alpine
|
||||||
- 'not (ansible_distribution == "Alpine")'
|
- 'not (ansible_facts.distribution == "Alpine")'
|
||||||
|
|
||||||
loop: "{{ query('dict', tested_filesystems)|product(['create_fs', 'reset_fs_uuid', 'overwrite_another_fs', 'remove_fs', 'set_fs_uuid_on_creation', 'set_fs_uuid_on_creation_with_opts'])|list }}"
|
loop: "{{ query('dict', tested_filesystems)|product(['create_fs', 'reset_fs_uuid', 'overwrite_another_fs', 'remove_fs', 'set_fs_uuid_on_creation', 'set_fs_uuid_on_creation_with_opts'])|list }}"
|
||||||
|
|
||||||
|
|
@ -92,8 +92,8 @@
|
||||||
|
|
||||||
- include_tasks: freebsd_setup.yml
|
- include_tasks: freebsd_setup.yml
|
||||||
when:
|
when:
|
||||||
- 'ansible_system == "FreeBSD"'
|
- 'ansible_facts.system == "FreeBSD"'
|
||||||
- 'ansible_distribution_version is version("12.2", ">=")'
|
- 'ansible_facts.distribution_version is version("12.2", ">=")'
|
||||||
|
|
||||||
- include_tasks: create_device.yml
|
- include_tasks: create_device.yml
|
||||||
vars:
|
vars:
|
||||||
|
|
@ -103,7 +103,7 @@
|
||||||
grow: '{{ item.0.value.grow }}'
|
grow: '{{ item.0.value.grow }}'
|
||||||
action: '{{ item.1 }}'
|
action: '{{ item.1 }}'
|
||||||
when:
|
when:
|
||||||
- 'ansible_system == "FreeBSD"'
|
- 'ansible_facts.system == "FreeBSD"'
|
||||||
- 'ansible_distribution_version is version("12.2", ">=")'
|
- 'ansible_facts.distribution_version is version("12.2", ">=")'
|
||||||
- 'item.0.key in ["xfs", "vfat"]'
|
- 'item.0.key in ["xfs", "vfat"]'
|
||||||
loop: "{{ query('dict', tested_filesystems)|product(['create_fs', 'overwrite_another_fs', 'remove_fs'])|list }}"
|
loop: "{{ query('dict', tested_filesystems)|product(['create_fs', 'overwrite_another_fs', 'remove_fs'])|list }}"
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@
|
||||||
# Skip UUID reset tests for FreeBSD due to "xfs_admin: only 'rewrite' supported on V5 fs"
|
# Skip UUID reset tests for FreeBSD due to "xfs_admin: only 'rewrite' supported on V5 fs"
|
||||||
- when:
|
- when:
|
||||||
- new_uuid | default(False)
|
- new_uuid | default(False)
|
||||||
- not (ansible_system == "FreeBSD" and fstype == "xfs")
|
- not (ansible_facts.system == "FreeBSD" and fstype == "xfs")
|
||||||
block:
|
block:
|
||||||
- name: "Create filesystem ({{ fstype }})"
|
- name: "Create filesystem ({{ fstype }})"
|
||||||
community.general.filesystem:
|
community.general.filesystem:
|
||||||
|
|
@ -42,8 +42,8 @@
|
||||||
|
|
||||||
- when:
|
- when:
|
||||||
- (grow | bool and (fstype != "vfat" or resize_vfat)) or
|
- (grow | bool and (fstype != "vfat" or resize_vfat)) or
|
||||||
(fstype == "xfs" and ansible_system == "Linux" and
|
(fstype == "xfs" and ansible_facts.system == "Linux" and
|
||||||
ansible_distribution not in ["CentOS", "Ubuntu"])
|
ansible_facts.distribution not in ["CentOS", "Ubuntu"])
|
||||||
block:
|
block:
|
||||||
- name: "Reset filesystem ({{ fstype }}) UUID and resizefs"
|
- name: "Reset filesystem ({{ fstype }}) UUID and resizefs"
|
||||||
ignore_errors: true
|
ignore_errors: true
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@
|
||||||
# Skip UUID set at creation tests for FreeBSD due to "xfs_admin: only 'rewrite' supported on V5 fs"
|
# Skip UUID set at creation tests for FreeBSD due to "xfs_admin: only 'rewrite' supported on V5 fs"
|
||||||
- when:
|
- when:
|
||||||
- new_uuid | default(False)
|
- new_uuid | default(False)
|
||||||
- not (ansible_system == "FreeBSD" and fstype == "xfs")
|
- not (ansible_facts.system == "FreeBSD" and fstype == "xfs")
|
||||||
block:
|
block:
|
||||||
- name: "Create filesystem ({{ fstype }}) with UUID"
|
- name: "Create filesystem ({{ fstype }}) with UUID"
|
||||||
community.general.filesystem:
|
community.general.filesystem:
|
||||||
|
|
|
||||||
|
|
@ -21,27 +21,27 @@
|
||||||
when:
|
when:
|
||||||
# bcachefs only on Alpine > 3.18 and Arch Linux for now
|
# bcachefs only on Alpine > 3.18 and Arch Linux for now
|
||||||
# other distributions have too old versions of bcachefs-tools and/or util-linux (blkid for UUID tests)
|
# other distributions have too old versions of bcachefs-tools and/or util-linux (blkid for UUID tests)
|
||||||
- ansible_distribution == "Alpine" and ansible_distribution_version is version("3.18", ">")
|
- ansible_facts.distribution == "Alpine" and ansible_facts.distribution_version is version("3.18", ">")
|
||||||
- ansible_distribution == "Archlinux"
|
- ansible_facts.distribution == "Archlinux"
|
||||||
|
|
||||||
- name: "Install btrfs progs"
|
- name: "Install btrfs progs"
|
||||||
ansible.builtin.package:
|
ansible.builtin.package:
|
||||||
name: btrfs-progs
|
name: btrfs-progs
|
||||||
state: present
|
state: present
|
||||||
when:
|
when:
|
||||||
- ansible_os_family != 'Suse'
|
- ansible_facts.os_family != 'Suse'
|
||||||
- not (ansible_distribution == 'Ubuntu' and ansible_distribution_version is version('16.04', '<='))
|
- not (ansible_facts.distribution == 'Ubuntu' and ansible_facts.distribution_version is version('16.04', '<='))
|
||||||
- ansible_system != "FreeBSD"
|
- ansible_facts.system != "FreeBSD"
|
||||||
- not (ansible_facts.os_family == "RedHat" and ansible_facts.distribution_major_version is version('8', '>='))
|
- not (ansible_facts.os_family == "RedHat" and ansible_facts.distribution_major_version is version('8', '>='))
|
||||||
- ansible_os_family != 'Archlinux' # TODO
|
- ansible_facts.os_family != 'Archlinux' # TODO
|
||||||
|
|
||||||
- name: "Install btrfs tools (Ubuntu <= 16.04)"
|
- name: "Install btrfs tools (Ubuntu <= 16.04)"
|
||||||
ansible.builtin.package:
|
ansible.builtin.package:
|
||||||
name: btrfs-tools
|
name: btrfs-tools
|
||||||
state: present
|
state: present
|
||||||
when:
|
when:
|
||||||
- ansible_distribution == 'Ubuntu'
|
- ansible_facts.distribution == 'Ubuntu'
|
||||||
- ansible_distribution_version is version('16.04', '<=')
|
- ansible_facts.distribution_version is version('16.04', '<=')
|
||||||
|
|
||||||
- name: "Install btrfs progs (OpenSuse)"
|
- name: "Install btrfs progs (OpenSuse)"
|
||||||
ansible.builtin.package:
|
ansible.builtin.package:
|
||||||
|
|
@ -49,14 +49,14 @@
|
||||||
- python3-xml
|
- python3-xml
|
||||||
- btrfsprogs
|
- btrfsprogs
|
||||||
state: present
|
state: present
|
||||||
when: ansible_os_family == 'Suse'
|
when: ansible_facts.os_family == 'Suse'
|
||||||
|
|
||||||
- name: "Install reiserfs utils (Fedora)"
|
- name: "Install reiserfs utils (Fedora)"
|
||||||
ansible.builtin.package:
|
ansible.builtin.package:
|
||||||
name: reiserfs-utils
|
name: reiserfs-utils
|
||||||
state: present
|
state: present
|
||||||
when:
|
when:
|
||||||
- ansible_distribution == 'Fedora' and (ansible_facts.distribution_major_version | int < 35)
|
- ansible_facts.distribution == 'Fedora' and (ansible_facts.distribution_major_version | int < 35)
|
||||||
|
|
||||||
- name: "Install reiserfs and util-linux-systemd (for findmnt) (OpenSuse)"
|
- name: "Install reiserfs and util-linux-systemd (for findmnt) (OpenSuse)"
|
||||||
ansible.builtin.package:
|
ansible.builtin.package:
|
||||||
|
|
@ -65,34 +65,34 @@
|
||||||
- util-linux-systemd
|
- util-linux-systemd
|
||||||
state: present
|
state: present
|
||||||
when:
|
when:
|
||||||
- ansible_os_family == 'Suse'
|
- ansible_facts.os_family == 'Suse'
|
||||||
|
|
||||||
- name: "Install reiserfs progs (Debian and more)"
|
- name: "Install reiserfs progs (Debian and more)"
|
||||||
ansible.builtin.package:
|
ansible.builtin.package:
|
||||||
name: reiserfsprogs
|
name: reiserfsprogs
|
||||||
state: present
|
state: present
|
||||||
when:
|
when:
|
||||||
- ansible_system == 'Linux'
|
- ansible_facts.system == 'Linux'
|
||||||
- ansible_os_family not in ['Suse', 'RedHat', 'Alpine', 'Archlinux']
|
- ansible_facts.os_family not in ['Suse', 'RedHat', 'Alpine', 'Archlinux']
|
||||||
|
|
||||||
- name: "Install reiserfs progs (FreeBSD)"
|
- name: "Install reiserfs progs (FreeBSD)"
|
||||||
ansible.builtin.package:
|
ansible.builtin.package:
|
||||||
name: progsreiserfs
|
name: progsreiserfs
|
||||||
state: present
|
state: present
|
||||||
when:
|
when:
|
||||||
- ansible_system == 'FreeBSD'
|
- ansible_facts.system == 'FreeBSD'
|
||||||
|
|
||||||
- name: "Install ocfs2 (Debian)"
|
- name: "Install ocfs2 (Debian)"
|
||||||
ansible.builtin.package:
|
ansible.builtin.package:
|
||||||
name: ocfs2-tools
|
name: ocfs2-tools
|
||||||
state: present
|
state: present
|
||||||
when: ansible_os_family == 'Debian'
|
when: ansible_facts.os_family == 'Debian'
|
||||||
|
|
||||||
- name: "Install f2fs tools and get version"
|
- name: "Install f2fs tools and get version"
|
||||||
when:
|
when:
|
||||||
- ansible_os_family != 'RedHat' or ansible_distribution == 'Fedora'
|
- ansible_facts.os_family != 'RedHat' or ansible_facts.distribution == 'Fedora'
|
||||||
- ansible_distribution != 'Ubuntu' or ansible_distribution_version is version('16.04', '>=')
|
- ansible_facts.distribution != 'Ubuntu' or ansible_facts.distribution_version is version('16.04', '>=')
|
||||||
- ansible_system != "FreeBSD"
|
- ansible_facts.system != "FreeBSD"
|
||||||
block:
|
block:
|
||||||
- name: "Install f2fs tools"
|
- name: "Install f2fs tools"
|
||||||
ansible.builtin.package:
|
ansible.builtin.package:
|
||||||
|
|
@ -117,14 +117,14 @@
|
||||||
name:
|
name:
|
||||||
- dosfstools
|
- dosfstools
|
||||||
- lvm2
|
- lvm2
|
||||||
when: ansible_system == 'Linux'
|
when: ansible_facts.system == 'Linux'
|
||||||
|
|
||||||
- name: "Install fatresize and get version"
|
- name: "Install fatresize and get version"
|
||||||
when:
|
when:
|
||||||
- ansible_system == 'Linux'
|
- ansible_facts.system == 'Linux'
|
||||||
- ansible_os_family != 'Suse'
|
- ansible_facts.os_family != 'Suse'
|
||||||
- ansible_os_family != 'RedHat' or (ansible_distribution == 'CentOS' and ansible_distribution_version is version('7.0', '=='))
|
- ansible_facts.os_family != 'RedHat' or (ansible_facts.distribution == 'CentOS' and ansible_facts.distribution_version is version('7.0', '=='))
|
||||||
- ansible_os_family != 'Alpine'
|
- ansible_facts.os_family != 'Alpine'
|
||||||
block:
|
block:
|
||||||
- name: "Install fatresize"
|
- name: "Install fatresize"
|
||||||
ansible.builtin.package:
|
ansible.builtin.package:
|
||||||
|
|
|
||||||
|
|
@ -3,12 +3,6 @@
|
||||||
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
|
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
|
||||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
|
||||||
- name: Debug ansible_version
|
|
||||||
ansible.builtin.debug:
|
|
||||||
var: ansible_version
|
|
||||||
when: not (quiet_test | default(true) | bool)
|
|
||||||
tags: ansible_version
|
|
||||||
|
|
||||||
- name: Tests
|
- name: Tests
|
||||||
ansible.builtin.assert:
|
ansible.builtin.assert:
|
||||||
that:
|
that:
|
||||||
|
|
|
||||||
|
|
@ -3,12 +3,6 @@
|
||||||
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
|
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
|
||||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
|
||||||
- name: Debug ansible_version
|
|
||||||
debug:
|
|
||||||
var: ansible_version
|
|
||||||
when: debug_test|default(false)|bool
|
|
||||||
tags: t0
|
|
||||||
|
|
||||||
- name: 1. Test lists merged by attribute name
|
- name: 1. Test lists merged by attribute name
|
||||||
block:
|
block:
|
||||||
- name: Test lists merged by attribute name debug
|
- name: Test lists merged by attribute name debug
|
||||||
|
|
|
||||||
|
|
@ -3,12 +3,6 @@
|
||||||
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
|
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
|
||||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
|
||||||
- name: Debug ansible_version
|
|
||||||
ansible.builtin.debug:
|
|
||||||
var: ansible_version
|
|
||||||
when: not (quiet_test | default(true) | bool)
|
|
||||||
tags: ansible_version
|
|
||||||
|
|
||||||
- name: Tests
|
- name: Tests
|
||||||
ansible.builtin.assert:
|
ansible.builtin.assert:
|
||||||
that:
|
that:
|
||||||
|
|
|
||||||
|
|
@ -3,12 +3,6 @@
|
||||||
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
|
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
|
||||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
|
||||||
- name: Debug ansible_version
|
|
||||||
ansible.builtin.debug:
|
|
||||||
var: ansible_version
|
|
||||||
when: not (quiet_test | default(true) | bool)
|
|
||||||
tags: ansible_version
|
|
||||||
|
|
||||||
- name: Tests
|
- name: Tests
|
||||||
ansible.builtin.assert:
|
ansible.builtin.assert:
|
||||||
that:
|
that:
|
||||||
|
|
|
||||||
|
|
@ -60,5 +60,5 @@
|
||||||
pkill -f -- '{{ remote_tmp_dir }}/serve.py'
|
pkill -f -- '{{ remote_tmp_dir }}/serve.py'
|
||||||
|
|
||||||
when: |
|
when: |
|
||||||
ansible_distribution == 'Fedora' or
|
ansible_facts.distribution == 'Fedora' or
|
||||||
ansible_distribution == 'Ubuntu' and not ansible_distribution_major_version | int < 16
|
ansible_facts.distribution == 'Ubuntu' and not ansible_facts.distribution_major_version | int < 16
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@
|
||||||
name: flatpak
|
name: flatpak
|
||||||
state: present
|
state: present
|
||||||
become: true
|
become: true
|
||||||
when: ansible_distribution == 'Fedora'
|
when: ansible_facts.distribution == 'Fedora'
|
||||||
|
|
||||||
- block:
|
- block:
|
||||||
- name: Activate flatpak ppa on Ubuntu
|
- name: Activate flatpak ppa on Ubuntu
|
||||||
|
|
@ -16,14 +16,14 @@
|
||||||
repo: ppa:alexlarsson/flatpak
|
repo: ppa:alexlarsson/flatpak
|
||||||
state: present
|
state: present
|
||||||
mode: '0644'
|
mode: '0644'
|
||||||
when: ansible_lsb.major_release | int < 18
|
when: ansible_facts.lsb.major_release | int < 18
|
||||||
|
|
||||||
- name: Install flatpak package on Ubuntu
|
- name: Install flatpak package on Ubuntu
|
||||||
apt:
|
apt:
|
||||||
name: flatpak
|
name: flatpak
|
||||||
state: present
|
state: present
|
||||||
|
|
||||||
when: ansible_distribution == 'Ubuntu'
|
when: ansible_facts.distribution == 'Ubuntu'
|
||||||
|
|
||||||
- name: Install dummy remote for user
|
- name: Install dummy remote for user
|
||||||
flatpak_remote:
|
flatpak_remote:
|
||||||
|
|
@ -62,7 +62,7 @@
|
||||||
mode: '0755'
|
mode: '0755'
|
||||||
|
|
||||||
- name: Start HTTP server
|
- name: Start HTTP server
|
||||||
command: '{{ ansible_python.executable }} {{ remote_tmp_dir }}/serve.py 127.0.0.1 8000 /tmp/flatpak/'
|
command: '{{ ansible_facts.python.executable }} {{ remote_tmp_dir }}/serve.py 127.0.0.1 8000 /tmp/flatpak/'
|
||||||
async: 120
|
async: 120
|
||||||
poll: 0
|
poll: 0
|
||||||
register: webserver_status
|
register: webserver_status
|
||||||
|
|
|
||||||
|
|
@ -46,5 +46,5 @@
|
||||||
method: system
|
method: system
|
||||||
|
|
||||||
when: |
|
when: |
|
||||||
ansible_distribution == 'Fedora' or
|
ansible_facts.distribution == 'Fedora' or
|
||||||
ansible_distribution == 'Ubuntu' and not ansible_distribution_major_version | int < 16
|
ansible_facts.distribution == 'Ubuntu' and not ansible_facts.distribution_major_version | int < 16
|
||||||
|
|
|
||||||
|
|
@ -7,19 +7,19 @@
|
||||||
dnf:
|
dnf:
|
||||||
name: flatpak
|
name: flatpak
|
||||||
state: present
|
state: present
|
||||||
when: ansible_distribution == 'Fedora'
|
when: ansible_facts.distribution == 'Fedora'
|
||||||
- block:
|
- block:
|
||||||
- name: Activate flatpak ppa on Ubuntu versions older than 18.04/bionic
|
- name: Activate flatpak ppa on Ubuntu versions older than 18.04/bionic
|
||||||
apt_repository:
|
apt_repository:
|
||||||
repo: ppa:alexlarsson/flatpak
|
repo: ppa:alexlarsson/flatpak
|
||||||
state: present
|
state: present
|
||||||
mode: '0644'
|
mode: '0644'
|
||||||
when: ansible_lsb.major_release | int < 18
|
when: ansible_facts.lsb.major_release | int < 18
|
||||||
- name: Install flatpak package on Ubuntu
|
- name: Install flatpak package on Ubuntu
|
||||||
apt:
|
apt:
|
||||||
name: flatpak
|
name: flatpak
|
||||||
state: present
|
state: present
|
||||||
when: ansible_distribution == 'Ubuntu'
|
when: ansible_facts.distribution == 'Ubuntu'
|
||||||
- name: Install flatpak remote for testing check mode
|
- name: Install flatpak remote for testing check mode
|
||||||
flatpak_remote:
|
flatpak_remote:
|
||||||
name: check-mode-test-remote
|
name: check-mode-test-remote
|
||||||
|
|
|
||||||
|
|
@ -10,16 +10,16 @@
|
||||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
|
||||||
- when:
|
- when:
|
||||||
- not (ansible_os_family == 'Alpine') # TODO
|
- not (ansible_facts.os_family == 'Alpine') # TODO
|
||||||
block:
|
block:
|
||||||
|
|
||||||
- include_vars: '{{ item }}'
|
- include_vars: '{{ item }}'
|
||||||
with_first_found:
|
with_first_found:
|
||||||
- files:
|
- files:
|
||||||
- '{{ ansible_distribution }}-{{ ansible_distribution_major_version }}.yml'
|
- '{{ ansible_facts.distribution }}-{{ ansible_facts.distribution_major_version }}.yml'
|
||||||
- '{{ ansible_distribution }}-{{ ansible_distribution_version }}.yml'
|
- '{{ ansible_facts.distribution }}-{{ ansible_facts.distribution_version }}.yml'
|
||||||
- '{{ ansible_distribution }}.yml'
|
- '{{ ansible_facts.distribution }}.yml'
|
||||||
- '{{ ansible_os_family }}.yml'
|
- '{{ ansible_facts.os_family }}.yml'
|
||||||
- 'default.yml'
|
- 'default.yml'
|
||||||
paths: '../vars'
|
paths: '../vars'
|
||||||
|
|
||||||
|
|
@ -28,7 +28,7 @@
|
||||||
name: "{{ item }}"
|
name: "{{ item }}"
|
||||||
state: present
|
state: present
|
||||||
loop: "{{ test_packages }}"
|
loop: "{{ test_packages }}"
|
||||||
when: ansible_distribution != "MacOSX"
|
when: ansible_facts.distribution != "MacOSX"
|
||||||
|
|
||||||
- name: Install a gem
|
- name: Install a gem
|
||||||
gem:
|
gem:
|
||||||
|
|
@ -44,7 +44,7 @@
|
||||||
msg: "failed to install gem: {{ install_gem_result.msg }}"
|
msg: "failed to install gem: {{ install_gem_result.msg }}"
|
||||||
when:
|
when:
|
||||||
- install_gem_result is failed
|
- install_gem_result is failed
|
||||||
- not (ansible_user_uid == 0 and "User --install-dir or --user-install but not both" not in install_gem_result.msg)
|
- not (ansible_facts.user_uid == 0 and "User --install-dir or --user-install but not both" not in install_gem_result.msg)
|
||||||
|
|
||||||
- block:
|
- block:
|
||||||
- name: List gems
|
- name: List gems
|
||||||
|
|
@ -108,7 +108,7 @@
|
||||||
that:
|
that:
|
||||||
- remove_gem_results is changed
|
- remove_gem_results is changed
|
||||||
- current_gems.stdout is not search('gist\s+\([0-9.]+\)')
|
- current_gems.stdout is not search('gist\s+\([0-9.]+\)')
|
||||||
when: ansible_user_uid == 0
|
when: ansible_facts.user_uid == 0
|
||||||
|
|
||||||
# Check custom gem directory
|
# Check custom gem directory
|
||||||
- name: Install gem in a custom directory with incorrect options
|
- name: Install gem in a custom directory with incorrect options
|
||||||
|
|
@ -217,12 +217,12 @@
|
||||||
community.general.gem:
|
community.general.gem:
|
||||||
name: json
|
name: json
|
||||||
state: absent
|
state: absent
|
||||||
when: ansible_distribution == "Ubuntu"
|
when: ansible_facts.distribution == "Ubuntu"
|
||||||
register: gem_result
|
register: gem_result
|
||||||
ignore_errors: true
|
ignore_errors: true
|
||||||
|
|
||||||
- name: Assert gem uninstall failed as expected
|
- name: Assert gem uninstall failed as expected
|
||||||
when: ansible_distribution == "Ubuntu"
|
when: ansible_facts.distribution == "Ubuntu"
|
||||||
assert:
|
assert:
|
||||||
that:
|
that:
|
||||||
- gem_result is failed
|
- gem_result is failed
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@
|
||||||
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
|
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
|
||||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
|
||||||
- when: ansible_distribution in ['MacOSX']
|
- when: ansible_facts.distribution in ['MacOSX']
|
||||||
block:
|
block:
|
||||||
- include_tasks: 'formulae.yml'
|
- include_tasks: 'formulae.yml'
|
||||||
- include_tasks: 'casks.yml'
|
- include_tasks: 'casks.yml'
|
||||||
|
|
|
||||||
|
|
@ -12,13 +12,13 @@
|
||||||
- name: Find brew binary
|
- name: Find brew binary
|
||||||
command: which brew
|
command: which brew
|
||||||
register: brew_which
|
register: brew_which
|
||||||
when: ansible_distribution in ['MacOSX']
|
when: ansible_facts.distribution in ['MacOSX']
|
||||||
|
|
||||||
- name: Get owner of brew binary
|
- name: Get owner of brew binary
|
||||||
stat:
|
stat:
|
||||||
path: "{{ brew_which.stdout }}"
|
path: "{{ brew_which.stdout }}"
|
||||||
register: brew_stat
|
register: brew_stat
|
||||||
when: ansible_distribution in ['MacOSX']
|
when: ansible_facts.distribution in ['MacOSX']
|
||||||
|
|
||||||
- block:
|
- block:
|
||||||
- name: Install cask
|
- name: Install cask
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@
|
||||||
- name: Install legacycrypt on Python 3.13+
|
- name: Install legacycrypt on Python 3.13+
|
||||||
pip:
|
pip:
|
||||||
name: legacycrypt
|
name: legacycrypt
|
||||||
when: ansible_python_version is version("3.13", ">=")
|
when: ansible_facts.python_version is version("3.13", ">=")
|
||||||
|
|
||||||
- name: Check and start systemd-homed service
|
- name: Check and start systemd-homed service
|
||||||
service:
|
service:
|
||||||
|
|
@ -183,5 +183,5 @@
|
||||||
# homectl was first introduced in systemd 245 so check version >= 245 and make sure system has systemd and homectl command
|
# homectl was first introduced in systemd 245 so check version >= 245 and make sure system has systemd and homectl command
|
||||||
when:
|
when:
|
||||||
- systemd_version.rc == 0 and (systemd_version.stdout | regex_search('[0-9][0-9][0-9]') | int >= 245) and homectl_version.rc == 0
|
- systemd_version.rc == 0 and (systemd_version.stdout | regex_search('[0-9][0-9][0-9]') | int >= 245) and homectl_version.rc == 0
|
||||||
- ansible_distribution != 'Archlinux' # TODO!
|
- ansible_facts.distribution != 'Archlinux' # TODO!
|
||||||
- ansible_distribution != 'Fedora' or ansible_distribution_major_version|int < 36 # TODO!
|
- ansible_facts.distribution != 'Fedora' or ansible_facts.distribution_major_version|int < 36 # TODO!
|
||||||
|
|
|
||||||
|
|
@ -9,4 +9,4 @@
|
||||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
|
||||||
- include_tasks: tests.yml
|
- include_tasks: tests.yml
|
||||||
when: ansible_distribution == 'Ubuntu' and ansible_distribution_release == 'trusty'
|
when: ansible_facts.distribution == 'Ubuntu' and ansible_facts.distribution_release == 'trusty'
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@
|
||||||
|
|
||||||
- set_fact:
|
- set_fact:
|
||||||
validate_certs: false
|
validate_certs: false
|
||||||
when: (ansible_distribution == "MacOSX" and ansible_distribution_version == "10.11.1")
|
when: (ansible_facts.distribution == "MacOSX" and ansible_facts.distribution_version == "10.11.1")
|
||||||
|
|
||||||
- name: get information about current IP using ipify facts
|
- name: get information about current IP using ipify facts
|
||||||
ipify_facts:
|
ipify_facts:
|
||||||
|
|
|
||||||
|
|
@ -52,12 +52,12 @@
|
||||||
|
|
||||||
- set_fact:
|
- set_fact:
|
||||||
file_contents: "{{ get_file_content.stdout }}"
|
file_contents: "{{ get_file_content.stdout }}"
|
||||||
when: ansible_distribution == 'RedHat' and ansible_distribution_version is version('7.9', '==')
|
when: ansible_facts.distribution == 'RedHat' and ansible_facts.distribution_version is version('7.9', '==')
|
||||||
|
|
||||||
- name: Get the content of file test02.cfg
|
- name: Get the content of file test02.cfg
|
||||||
set_fact:
|
set_fact:
|
||||||
file_contents: "{{ lookup('file', mount_root_dir + '/test02.cfg') }}"
|
file_contents: "{{ lookup('file', mount_root_dir + '/test02.cfg') }}"
|
||||||
when: not (ansible_distribution == 'RedHat' and ansible_distribution_version is version('7.9', '=='))
|
when: not (ansible_facts.distribution == 'RedHat' and ansible_facts.distribution_version is version('7.9', '=='))
|
||||||
|
|
||||||
- fail: msg="Failed to replace the file test02.cfg"
|
- fail: msg="Failed to replace the file test02.cfg"
|
||||||
when: file_contents != "test"
|
when: file_contents != "test"
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@
|
||||||
delete_files:
|
delete_files:
|
||||||
- "test01.cfg"
|
- "test01.cfg"
|
||||||
|
|
||||||
- debug: var=ansible_distribution
|
- debug: var=ansible_facts.distribution
|
||||||
|
|
||||||
- include_tasks: iso_mount.yml
|
- include_tasks: iso_mount.yml
|
||||||
vars:
|
vars:
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
|
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
|
||||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
|
||||||
- debug: var=ansible_distribution
|
- debug: var=ansible_facts.distribution
|
||||||
|
|
||||||
- block:
|
- block:
|
||||||
- name: "Mount customized ISO on MAC"
|
- name: "Mount customized ISO on MAC"
|
||||||
|
|
@ -20,7 +20,7 @@
|
||||||
- set_fact:
|
- set_fact:
|
||||||
mount_root_dir: "{{ test_dir }}/iso_mount/CDROM"
|
mount_root_dir: "{{ test_dir }}/iso_mount/CDROM"
|
||||||
when: iso_name.find('udf') != -1
|
when: iso_name.find('udf') != -1
|
||||||
when: ansible_distribution == "MacOSX"
|
when: ansible_facts.distribution == "MacOSX"
|
||||||
|
|
||||||
- block:
|
- block:
|
||||||
- name: "Mount {{ iso_name }} to {{ test_dir }}/iso_mount on localhost"
|
- name: "Mount {{ iso_name }} to {{ test_dir }}/iso_mount on localhost"
|
||||||
|
|
@ -36,4 +36,4 @@
|
||||||
- set_fact:
|
- set_fact:
|
||||||
mount_root_dir: "{{ test_dir }}/iso_mount"
|
mount_root_dir: "{{ test_dir }}/iso_mount"
|
||||||
when:
|
when:
|
||||||
- ansible_distribution != "MacOSX"
|
- ansible_facts.distribution != "MacOSX"
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@
|
||||||
|
|
||||||
- name: Skip some platforms which does not support ansible.posix.mount
|
- name: Skip some platforms which does not support ansible.posix.mount
|
||||||
meta: end_play
|
meta: end_play
|
||||||
when: ansible_distribution in ['Alpine']
|
when: ansible_facts.distribution in ['Alpine']
|
||||||
|
|
||||||
- set_fact:
|
- set_fact:
|
||||||
test_dir: '{{ remote_tmp_dir }}/test_iso_customize'
|
test_dir: '{{ remote_tmp_dir }}/test_iso_customize'
|
||||||
|
|
|
||||||
|
|
@ -33,13 +33,13 @@
|
||||||
- name: MACOS | Find brew binary
|
- name: MACOS | Find brew binary
|
||||||
command: which brew
|
command: which brew
|
||||||
register: brew_which
|
register: brew_which
|
||||||
when: ansible_distribution in ['MacOSX']
|
when: ansible_facts.distribution in ['MacOSX']
|
||||||
|
|
||||||
- name: MACOS | Get owner of brew binary
|
- name: MACOS | Get owner of brew binary
|
||||||
stat:
|
stat:
|
||||||
path: "{{ brew_which.stdout }}"
|
path: "{{ brew_which.stdout }}"
|
||||||
register: brew_stat
|
register: brew_stat
|
||||||
when: ansible_distribution in ['MacOSX']
|
when: ansible_facts.distribution in ['MacOSX']
|
||||||
|
|
||||||
- name: MACOS | Install 7zip package
|
- name: MACOS | Install 7zip package
|
||||||
homebrew:
|
homebrew:
|
||||||
|
|
|
||||||
|
|
@ -17,14 +17,14 @@
|
||||||
- name: Doesn't work with Fedora 43 for some reason
|
- name: Doesn't work with Fedora 43 for some reason
|
||||||
meta: end_play
|
meta: end_play
|
||||||
when:
|
when:
|
||||||
- ansible_distribution == 'Fedora' and ansible_distribution_major_version is version('43', '==')
|
- ansible_facts.distribution == 'Fedora' and ansible_facts.distribution_major_version is version('43', '==')
|
||||||
|
|
||||||
- name: Install EPEL repository (RHEL only)
|
- name: Install EPEL repository (RHEL only)
|
||||||
include_role:
|
include_role:
|
||||||
name: setup_epel
|
name: setup_epel
|
||||||
when:
|
when:
|
||||||
- ansible_distribution in ['RedHat', 'CentOS']
|
- ansible_facts.distribution in ['RedHat', 'CentOS']
|
||||||
- ansible_distribution_major_version is version('9', '<')
|
- ansible_facts.distribution_major_version is version('9', '<')
|
||||||
|
|
||||||
- name: Install 7zip
|
- name: Install 7zip
|
||||||
import_tasks: 7zip.yml
|
import_tasks: 7zip.yml
|
||||||
|
|
|
||||||
|
|
@ -49,7 +49,7 @@
|
||||||
certificate_path: "{{ test_cert_path }}"
|
certificate_path: "{{ test_cert_path }}"
|
||||||
privatekey_path: "{{ test_key_path }}"
|
privatekey_path: "{{ test_key_path }}"
|
||||||
when:
|
when:
|
||||||
- "not (ansible_os_family == 'RedHat' and ansible_distribution_version is version('8.0', '<'))"
|
- "not (ansible_facts.os_family == 'RedHat' and ansible_facts.distribution_version is version('8.0', '<'))"
|
||||||
|
|
||||||
- name: Create the pkcs12 archive from the test x509 cert (command)
|
- name: Create the pkcs12 archive from the test x509 cert (command)
|
||||||
ansible.builtin.command:
|
ansible.builtin.command:
|
||||||
|
|
@ -62,8 +62,8 @@
|
||||||
-passout stdin
|
-passout stdin
|
||||||
stdin: "{{ test_keystore2_password }}"
|
stdin: "{{ test_keystore2_password }}"
|
||||||
when:
|
when:
|
||||||
- "ansible_os_family == 'RedHat'"
|
- "ansible_facts.os_family == 'RedHat'"
|
||||||
- "ansible_distribution_version is version('8.0', '<')"
|
- "ansible_facts.distribution_version is version('8.0', '<')"
|
||||||
|
|
||||||
- name: Create the pkcs12 archive from the certificate we will be trying to add to the keystore
|
- name: Create the pkcs12 archive from the certificate we will be trying to add to the keystore
|
||||||
community.crypto.openssl_pkcs12:
|
community.crypto.openssl_pkcs12:
|
||||||
|
|
@ -73,7 +73,7 @@
|
||||||
certificate_path: "{{ test_cert2_path }}"
|
certificate_path: "{{ test_cert2_path }}"
|
||||||
privatekey_path: "{{ test_key2_path }}"
|
privatekey_path: "{{ test_key2_path }}"
|
||||||
when:
|
when:
|
||||||
- "not (ansible_os_family == 'RedHat' and ansible_distribution_version is version('8.0', '<'))"
|
- "not (ansible_facts.os_family == 'RedHat' and ansible_facts.distribution_version is version('8.0', '<'))"
|
||||||
|
|
||||||
- name: Create the pkcs12 archive from the certificate we will be trying to add to the keystore (command)
|
- name: Create the pkcs12 archive from the certificate we will be trying to add to the keystore (command)
|
||||||
ansible.builtin.command:
|
ansible.builtin.command:
|
||||||
|
|
@ -86,8 +86,8 @@
|
||||||
-passout stdin
|
-passout stdin
|
||||||
stdin: "{{ test_keystore2_password }}"
|
stdin: "{{ test_keystore2_password }}"
|
||||||
when:
|
when:
|
||||||
- "ansible_os_family == 'RedHat'"
|
- "ansible_facts.os_family == 'RedHat'"
|
||||||
- "ansible_distribution_version is version('8.0', '<')"
|
- "ansible_facts.distribution_version is version('8.0', '<')"
|
||||||
|
|
||||||
#
|
#
|
||||||
# Run tests
|
# Run tests
|
||||||
|
|
@ -246,7 +246,7 @@
|
||||||
dest: "{{ remote_tmp_dir }}"
|
dest: "{{ remote_tmp_dir }}"
|
||||||
|
|
||||||
- name: Create an SSL server that we will use for testing URL imports
|
- name: Create an SSL server that we will use for testing URL imports
|
||||||
command: "{{ ansible_python.executable }} {{ remote_tmp_dir }}/setupSSLServer.py {{ remote_tmp_dir }} {{ test_ssl_port }}"
|
command: "{{ ansible_facts.python.executable }} {{ remote_tmp_dir }}/setupSSLServer.py {{ remote_tmp_dir }} {{ test_ssl_port }}"
|
||||||
async: 10
|
async: 10
|
||||||
poll: 0
|
poll: 0
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -27,4 +27,4 @@
|
||||||
- test_reload
|
- test_reload
|
||||||
- test_runatload
|
- test_runatload
|
||||||
|
|
||||||
when: ansible_os_family == 'Darwin'
|
when: ansible_facts.os_family == 'Darwin'
|
||||||
|
|
|
||||||
|
|
@ -13,4 +13,4 @@
|
||||||
- include_tasks: "{{ item }}"
|
- include_tasks: "{{ item }}"
|
||||||
with_fileglob:
|
with_fileglob:
|
||||||
- 'tests/*.yml'
|
- 'tests/*.yml'
|
||||||
when: ansible_os_family in ['Ubuntu', 'Debian']
|
when: ansible_facts.os_family in ['Ubuntu', 'Debian']
|
||||||
|
|
|
||||||
|
|
@ -13,4 +13,4 @@
|
||||||
- include_tasks: "{{ item }}"
|
- include_tasks: "{{ item }}"
|
||||||
with_fileglob:
|
with_fileglob:
|
||||||
- 'tests/*.yml'
|
- 'tests/*.yml'
|
||||||
when: ansible_os_family in ['Ubuntu', 'Debian']
|
when: ansible_facts.os_family in ['Ubuntu', 'Debian']
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@
|
||||||
- net-tools
|
- net-tools
|
||||||
- netcat-openbsd
|
- netcat-openbsd
|
||||||
state: latest
|
state: latest
|
||||||
when: ansible_os_family == "Debian"
|
when: ansible_facts.os_family == "Debian"
|
||||||
|
|
||||||
- name: install netstat and netcat on rh < 7
|
- name: install netstat and netcat on rh < 7
|
||||||
ansible.builtin.package:
|
ansible.builtin.package:
|
||||||
|
|
@ -23,87 +23,87 @@
|
||||||
- net-tools
|
- net-tools
|
||||||
- nc.x86_64
|
- nc.x86_64
|
||||||
state: latest
|
state: latest
|
||||||
when: ansible_os_family == "RedHat" and ansible_distribution_major_version|int < 7
|
when: ansible_facts.os_family == "RedHat" and ansible_facts.distribution_major_version|int < 7
|
||||||
|
|
||||||
- name: install netcat on rh >= 7
|
- name: install netcat on rh >= 7
|
||||||
ansible.builtin.package:
|
ansible.builtin.package:
|
||||||
name: 'nmap-ncat'
|
name: 'nmap-ncat'
|
||||||
state: latest
|
state: latest
|
||||||
when: ansible_os_family == "RedHat" and ansible_distribution_major_version|int >= 7
|
when: ansible_facts.os_family == "RedHat" and ansible_facts.distribution_major_version|int >= 7
|
||||||
|
|
||||||
- name: start UDP server on port 5555
|
- name: start UDP server on port 5555
|
||||||
command: nc -u -l -p 5555
|
command: nc -u -l -p 5555
|
||||||
async: 1000
|
async: 1000
|
||||||
poll: 0
|
poll: 0
|
||||||
when: (ansible_os_family == "RedHat" and ansible_distribution_major_version|int >= 7) or ansible_os_family == "Debian"
|
when: (ansible_facts.os_family == "RedHat" and ansible_facts.distribution_major_version|int >= 7) or ansible_facts.os_family == "Debian"
|
||||||
|
|
||||||
- name: start UDP server on port 5555
|
- name: start UDP server on port 5555
|
||||||
command: nc -u -l 5555
|
command: nc -u -l 5555
|
||||||
async: 1000
|
async: 1000
|
||||||
poll: 0
|
poll: 0
|
||||||
when: ansible_os_family == "RedHat" and ansible_distribution_major_version|int < 7
|
when: ansible_facts.os_family == "RedHat" and ansible_facts.distribution_major_version|int < 7
|
||||||
|
|
||||||
- name: start TCP server on port 5556
|
- name: start TCP server on port 5556
|
||||||
command: "nc -l -p 5556"
|
command: "nc -l -p 5556"
|
||||||
async: 1000
|
async: 1000
|
||||||
poll: 0
|
poll: 0
|
||||||
when: (ansible_os_family == "RedHat" and ansible_distribution_major_version|int >= 7) or ansible_os_family == "Debian"
|
when: (ansible_facts.os_family == "RedHat" and ansible_facts.distribution_major_version|int >= 7) or ansible_facts.os_family == "Debian"
|
||||||
|
|
||||||
- name: start TCP server on port 5556
|
- name: start TCP server on port 5556
|
||||||
command: "nc -l 5556"
|
command: "nc -l 5556"
|
||||||
async: 1000
|
async: 1000
|
||||||
poll: 0
|
poll: 0
|
||||||
when: ansible_os_family == "RedHat" and ansible_distribution_major_version|int < 7
|
when: ansible_facts.os_family == "RedHat" and ansible_facts.distribution_major_version|int < 7
|
||||||
|
|
||||||
- name: Gather listening ports facts
|
- name: Gather listening ports facts
|
||||||
listen_ports_facts:
|
listen_ports_facts:
|
||||||
when: ansible_os_family == "RedHat" or ansible_os_family == "Debian"
|
when: ansible_facts.os_family == "RedHat" or ansible_facts.os_family == "Debian"
|
||||||
|
|
||||||
- name: check that the include_non_listening parameters ('state' and 'foreign_address') are not active in default setting
|
- name: check that the include_non_listening parameters ('state' and 'foreign_address') are not active in default setting
|
||||||
assert:
|
assert:
|
||||||
that:
|
that:
|
||||||
- ansible_facts.tcp_listen | selectattr('state', 'defined') | list | length == 0
|
- ansible_facts.tcp_listen | selectattr('state', 'defined') | list | length == 0
|
||||||
- ansible_facts.tcp_listen | selectattr('foreign_address', 'defined') | list | length == 0
|
- ansible_facts.tcp_listen | selectattr('foreign_address', 'defined') | list | length == 0
|
||||||
when: ansible_os_family == "RedHat" or ansible_os_family == "Debian"
|
when: ansible_facts.os_family == "RedHat" or ansible_facts.os_family == "Debian"
|
||||||
|
|
||||||
- name: Gather listening ports facts explicitly via netstat and include_non_listening
|
- name: Gather listening ports facts explicitly via netstat and include_non_listening
|
||||||
listen_ports_facts:
|
listen_ports_facts:
|
||||||
command: 'netstat'
|
command: 'netstat'
|
||||||
include_non_listening: 'yes'
|
include_non_listening: 'yes'
|
||||||
when: (ansible_os_family == "RedHat" and ansible_distribution_major_version|int < 7) or ansible_os_family == "Debian"
|
when: (ansible_facts.os_family == "RedHat" and ansible_facts.distribution_major_version|int < 7) or ansible_facts.os_family == "Debian"
|
||||||
|
|
||||||
- name: Gather listening ports facts explicitly via ss and include_non_listening
|
- name: Gather listening ports facts explicitly via ss and include_non_listening
|
||||||
listen_ports_facts:
|
listen_ports_facts:
|
||||||
command: 'ss'
|
command: 'ss'
|
||||||
include_non_listening: 'yes'
|
include_non_listening: 'yes'
|
||||||
when: ansible_os_family == "RedHat" and ansible_distribution_major_version|int >= 7
|
when: ansible_facts.os_family == "RedHat" and ansible_facts.distribution_major_version|int >= 7
|
||||||
|
|
||||||
- name: check for ansible_facts.udp_listen exists
|
- name: check for ansible_facts.udp_listen exists
|
||||||
assert:
|
assert:
|
||||||
that: ansible_facts.udp_listen is defined
|
that: ansible_facts.udp_listen is defined
|
||||||
when: ansible_os_family == "RedHat" or ansible_os_family == "Debian"
|
when: ansible_facts.os_family == "RedHat" or ansible_facts.os_family == "Debian"
|
||||||
|
|
||||||
- name: check for ansible_facts.tcp_listen exists
|
- name: check for ansible_facts.tcp_listen exists
|
||||||
assert:
|
assert:
|
||||||
that: ansible_facts.tcp_listen is defined
|
that: ansible_facts.tcp_listen is defined
|
||||||
when: ansible_os_family == "RedHat" or ansible_os_family == "Debian"
|
when: ansible_facts.os_family == "RedHat" or ansible_facts.os_family == "Debian"
|
||||||
|
|
||||||
- name: check that the include_non_listening parameter 'state' and 'foreign_address' exists
|
- name: check that the include_non_listening parameter 'state' and 'foreign_address' exists
|
||||||
assert:
|
assert:
|
||||||
that:
|
that:
|
||||||
- ansible_facts.tcp_listen | selectattr('state', 'defined') | list | length > 0
|
- ansible_facts.tcp_listen | selectattr('state', 'defined') | list | length > 0
|
||||||
- ansible_facts.tcp_listen | selectattr('foreign_address', 'defined') | list | length > 0
|
- ansible_facts.tcp_listen | selectattr('foreign_address', 'defined') | list | length > 0
|
||||||
when: ansible_os_family == "RedHat" or ansible_os_family == "Debian"
|
when: ansible_facts.os_family == "RedHat" or ansible_facts.os_family == "Debian"
|
||||||
|
|
||||||
- name: check TCP 5556 is in listening ports
|
- name: check TCP 5556 is in listening ports
|
||||||
assert:
|
assert:
|
||||||
that: 5556 in ansible_facts.tcp_listen | map(attribute='port') | sort | list
|
that: 5556 in ansible_facts.tcp_listen | map(attribute='port') | sort | list
|
||||||
when: (ansible_os_family == "RedHat" and ansible_distribution_major_version|int >= 7) or ansible_os_family == "Debian"
|
when: (ansible_facts.os_family == "RedHat" and ansible_facts.distribution_major_version|int >= 7) or ansible_facts.os_family == "Debian"
|
||||||
|
|
||||||
- name: check UDP 5555 is in listening ports
|
- name: check UDP 5555 is in listening ports
|
||||||
assert:
|
assert:
|
||||||
that: 5555 in ansible_facts.udp_listen | map(attribute='port') | sort | list
|
that: 5555 in ansible_facts.udp_listen | map(attribute='port') | sort | list
|
||||||
when: (ansible_os_family == "RedHat" and ansible_distribution_major_version|int >= 7) or ansible_os_family == "Debian"
|
when: (ansible_facts.os_family == "RedHat" and ansible_facts.distribution_major_version|int >= 7) or ansible_facts.os_family == "Debian"
|
||||||
|
|
||||||
- name: kill all async commands
|
- name: kill all async commands
|
||||||
command: "kill -9 {{ item.pid }}"
|
command: "kill -9 {{ item.pid }}"
|
||||||
|
|
@ -112,7 +112,7 @@
|
||||||
ignore_errors: true
|
ignore_errors: true
|
||||||
|
|
||||||
|
|
||||||
- when: ansible_os_family == "Debian"
|
- when: ansible_facts.os_family == "Debian"
|
||||||
block:
|
block:
|
||||||
- name: Remove netstat and ss dependencies to simulate missing executables
|
- name: Remove netstat and ss dependencies to simulate missing executables
|
||||||
ansible.builtin.package:
|
ansible.builtin.package:
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@
|
||||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
|
||||||
- name: Arch-less block
|
- name: Arch-less block
|
||||||
when: ansible_distribution not in ['Archlinux']
|
when: ansible_facts.distribution not in ['Archlinux']
|
||||||
block:
|
block:
|
||||||
- name: Is the locale we're going to test against installed?
|
- name: Is the locale we're going to test against installed?
|
||||||
command: locale -a
|
command: locale -a
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@
|
||||||
|
|
||||||
- name: Bail out if not supported
|
- name: Bail out if not supported
|
||||||
ansible.builtin.meta: end_play
|
ansible.builtin.meta: end_play
|
||||||
when: ansible_distribution not in ('Ubuntu', 'Debian', 'Archlinux')
|
when: ansible_facts.distribution not in ('Ubuntu', 'Debian', 'Archlinux')
|
||||||
|
|
||||||
- name: Run tests auto-detecting mechanism
|
- name: Run tests auto-detecting mechanism
|
||||||
ansible.builtin.include_tasks: basic.yml
|
ansible.builtin.include_tasks: basic.yml
|
||||||
|
|
|
||||||
|
|
@ -13,4 +13,4 @@
|
||||||
- name: Setup test data
|
- name: Setup test data
|
||||||
script: test_db.py
|
script: test_db.py
|
||||||
args:
|
args:
|
||||||
executable: "{{ ansible_python.executable }}"
|
executable: "{{ ansible_facts.python.executable }}"
|
||||||
|
|
|
||||||
|
|
@ -5,9 +5,9 @@ SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
#}
|
#}
|
||||||
|
|
||||||
[security_privacy]
|
[security_privacy]
|
||||||
name=Crypto applications and utilities (openSUSE_Leap_{{ ansible_distribution_version }})
|
name=Crypto applications and utilities (openSUSE_Leap_{{ ansible_facts.distribution_version }})
|
||||||
type=rpm-md
|
type=rpm-md
|
||||||
baseurl=http://download.opensuse.org/repositories/security:/privacy/openSUSE_Leap_{{ ansible_distribution_version }}/
|
baseurl=http://download.opensuse.org/repositories/security:/privacy/openSUSE_Leap_{{ ansible_facts.distribution_version }}/
|
||||||
gpgcheck=1
|
gpgcheck=1
|
||||||
gpgkey=http://download.opensuse.org/repositories/security:/privacy/openSUSE_Leap_{{ ansible_distribution_version }}/repodata/repomd.xml.key
|
gpgkey=http://download.opensuse.org/repositories/security:/privacy/openSUSE_Leap_{{ ansible_facts.distribution_version }}/repodata/repomd.xml.key
|
||||||
enabled=1
|
enabled=1
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@
|
||||||
package:
|
package:
|
||||||
name: lvm2
|
name: lvm2
|
||||||
state: present
|
state: present
|
||||||
when: ansible_system == 'Linux'
|
when: ansible_facts.system == 'Linux'
|
||||||
|
|
||||||
- name: Test lvg module
|
- name: Test lvg module
|
||||||
block:
|
block:
|
||||||
|
|
|
||||||
|
|
@ -11,14 +11,14 @@
|
||||||
- name: "get lvm facts"
|
- name: "get lvm facts"
|
||||||
setup:
|
setup:
|
||||||
|
|
||||||
- debug: var=ansible_lvm
|
- debug: var=ansible_facts.lvm
|
||||||
|
|
||||||
- name: "Assert the testvg span only on first disk"
|
- name: "Assert the testvg span only on first disk"
|
||||||
assert:
|
assert:
|
||||||
that:
|
that:
|
||||||
- ansible_lvm.pvs[loop_device1].vg == "testvg"
|
- ansible_facts.lvm.pvs[loop_device1].vg == "testvg"
|
||||||
- 'loop_device2 not in ansible_lvm.pvs or
|
- 'loop_device2 not in ansible_facts.lvm.pvs or
|
||||||
ansible_lvm.pvs[loop_device2].vg == ""'
|
ansible_facts.lvm.pvs[loop_device2].vg == ""'
|
||||||
|
|
||||||
- name: "Extend to second disk AND reduce from the first disk"
|
- name: "Extend to second disk AND reduce from the first disk"
|
||||||
lvg:
|
lvg:
|
||||||
|
|
@ -28,11 +28,11 @@
|
||||||
- name: "get lvm facts"
|
- name: "get lvm facts"
|
||||||
setup:
|
setup:
|
||||||
|
|
||||||
- debug: var=ansible_lvm
|
- debug: var=ansible_facts.lvm
|
||||||
|
|
||||||
- name: "Assert the testvg span only on first disk"
|
- name: "Assert the testvg span only on first disk"
|
||||||
assert:
|
assert:
|
||||||
that:
|
that:
|
||||||
- 'loop_device1 not in ansible_lvm.pvs or
|
- 'loop_device1 not in ansible_facts.lvm.pvs or
|
||||||
ansible_lvm.pvs[loop_device1].vg == ""'
|
ansible_facts.lvm.pvs[loop_device1].vg == ""'
|
||||||
- ansible_lvm.pvs[loop_device2].vg == "testvg"
|
- ansible_facts.lvm.pvs[loop_device2].vg == "testvg"
|
||||||
|
|
|
||||||
|
|
@ -13,14 +13,14 @@
|
||||||
- name: "get lvm facts"
|
- name: "get lvm facts"
|
||||||
setup:
|
setup:
|
||||||
|
|
||||||
- debug: var=ansible_lvm
|
- debug: var=ansible_facts.lvm
|
||||||
|
|
||||||
- name: "Assert the testvg span only on first disk"
|
- name: "Assert the testvg span only on first disk"
|
||||||
assert:
|
assert:
|
||||||
that:
|
that:
|
||||||
- ansible_lvm.pvs[loop_device1].vg == "testvg"
|
- ansible_facts.lvm.pvs[loop_device1].vg == "testvg"
|
||||||
- 'loop_device2 not in ansible_lvm.pvs or
|
- 'loop_device2 not in ansible_facts.lvm.pvs or
|
||||||
ansible_lvm.pvs[loop_device2].vg == ""'
|
ansible_facts.lvm.pvs[loop_device2].vg == ""'
|
||||||
|
|
||||||
- name: "Extend to second disk AND keep first disk"
|
- name: "Extend to second disk AND keep first disk"
|
||||||
lvg:
|
lvg:
|
||||||
|
|
@ -31,10 +31,10 @@
|
||||||
- name: "get lvm facts"
|
- name: "get lvm facts"
|
||||||
setup:
|
setup:
|
||||||
|
|
||||||
- debug: var=ansible_lvm
|
- debug: var=ansible_facts.lvm
|
||||||
|
|
||||||
- name: "Assert the testvg spans on both disks"
|
- name: "Assert the testvg spans on both disks"
|
||||||
assert:
|
assert:
|
||||||
that:
|
that:
|
||||||
- ansible_lvm.pvs[loop_device1].vg == "testvg"
|
- ansible_facts.lvm.pvs[loop_device1].vg == "testvg"
|
||||||
- ansible_lvm.pvs[loop_device2].vg == "testvg"
|
- ansible_facts.lvm.pvs[loop_device2].vg == "testvg"
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@
|
||||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
|
||||||
- name: Install required packages (Linux)
|
- name: Install required packages (Linux)
|
||||||
when: ansible_system == 'Linux'
|
when: ansible_facts.system == 'Linux'
|
||||||
ansible.builtin.package:
|
ansible.builtin.package:
|
||||||
name: lvm2
|
name: lvm2
|
||||||
state: present
|
state: present
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@
|
||||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
|
||||||
- name: Install required packages (Linux)
|
- name: Install required packages (Linux)
|
||||||
when: ansible_system == 'Linux'
|
when: ansible_facts.system == 'Linux'
|
||||||
ansible.builtin.package:
|
ansible.builtin.package:
|
||||||
name: lvm2
|
name: lvm2
|
||||||
state: present
|
state: present
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@
|
||||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
|
||||||
- name: Install required packages (Linux)
|
- name: Install required packages (Linux)
|
||||||
when: ansible_system == 'Linux'
|
when: ansible_facts.system == 'Linux'
|
||||||
ansible.builtin.package:
|
ansible.builtin.package:
|
||||||
name:
|
name:
|
||||||
- lvm2
|
- lvm2
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@
|
||||||
package:
|
package:
|
||||||
name: lvm2
|
name: lvm2
|
||||||
state: present
|
state: present
|
||||||
when: ansible_system == 'Linux'
|
when: ansible_facts.system == 'Linux'
|
||||||
|
|
||||||
- name: Test lvol module
|
- name: Test lvol module
|
||||||
block:
|
block:
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@
|
||||||
|
|
||||||
- when:
|
- when:
|
||||||
# TODO: https://github.com/ansible-collections/community.general/issues/4656
|
# TODO: https://github.com/ansible-collections/community.general/issues/4656
|
||||||
- ansible_python.version.major != 3 or ansible_python.version.minor < 12
|
- ansible_facts.python.version.major != 3 or ansible_facts.python.version.minor < 12
|
||||||
block:
|
block:
|
||||||
|
|
||||||
# NOTE: If the system does not support smtpd-tls (python 2.6 and older) we do basic tests
|
# NOTE: If the system does not support smtpd-tls (python 2.6 and older) we do basic tests
|
||||||
|
|
@ -35,7 +35,7 @@
|
||||||
# FIXME: Verify the mail after it was send would be nice
|
# FIXME: Verify the mail after it was send would be nice
|
||||||
# This would require either dumping the content, or registering async task output
|
# This would require either dumping the content, or registering async task output
|
||||||
- name: Start test smtpserver
|
- name: Start test smtpserver
|
||||||
shell: '{{ ansible_python.executable }} {{ remote_tmp_dir }}/smtpserver.py 10025:10465'
|
shell: '{{ ansible_facts.python.executable }} {{ remote_tmp_dir }}/smtpserver.py 10025:10465'
|
||||||
async: 45
|
async: 45
|
||||||
poll: 0
|
poll: 0
|
||||||
register: smtpserver
|
register: smtpserver
|
||||||
|
|
|
||||||
|
|
@ -13,8 +13,8 @@
|
||||||
include_role:
|
include_role:
|
||||||
name: setup_epel
|
name: setup_epel
|
||||||
when:
|
when:
|
||||||
- ansible_distribution in ['RedHat', 'CentOS']
|
- ansible_facts.distribution in ['RedHat', 'CentOS']
|
||||||
- ansible_distribution_major_version is version('9', '<')
|
- ansible_facts.distribution_major_version is version('9', '<')
|
||||||
|
|
||||||
- name: create required directories
|
- name: create required directories
|
||||||
become: true
|
become: true
|
||||||
|
|
@ -36,7 +36,7 @@
|
||||||
with_first_found:
|
with_first_found:
|
||||||
- files:
|
- files:
|
||||||
- "{{ ansible_facts.distribution }}-{{ ansible_facts.distribution_major_version }}.yml"
|
- "{{ ansible_facts.distribution }}-{{ ansible_facts.distribution_major_version }}.yml"
|
||||||
- '{{ ansible_os_family }}.yml'
|
- '{{ ansible_facts.os_family }}.yml'
|
||||||
- 'defaults.yml'
|
- 'defaults.yml'
|
||||||
|
|
||||||
- name: monit config
|
- name: monit config
|
||||||
|
|
@ -55,13 +55,13 @@
|
||||||
package:
|
package:
|
||||||
name: virtualenv
|
name: virtualenv
|
||||||
state: present
|
state: present
|
||||||
when: ansible_distribution == 'CentOS' and ansible_distribution_major_version == '8'
|
when: ansible_facts.distribution == 'CentOS' and ansible_facts.distribution_major_version == '8'
|
||||||
|
|
||||||
- name: Install virtualenv on Arch Linux
|
- name: Install virtualenv on Arch Linux
|
||||||
pip:
|
pip:
|
||||||
name: virtualenv
|
name: virtualenv
|
||||||
state: present
|
state: present
|
||||||
when: ansible_os_family == 'Archlinux'
|
when: ansible_facts.os_family == 'Archlinux'
|
||||||
|
|
||||||
- name: install dependencies
|
- name: install dependencies
|
||||||
pip:
|
pip:
|
||||||
|
|
|
||||||
|
|
@ -10,5 +10,5 @@
|
||||||
|
|
||||||
- include_tasks: ubuntu.yml
|
- include_tasks: ubuntu.yml
|
||||||
when:
|
when:
|
||||||
- ansible_distribution == 'Ubuntu'
|
- ansible_facts.distribution == 'Ubuntu'
|
||||||
- ansible_distribution_release not in ['focal', 'jammy', 'noble']
|
- ansible_facts.distribution_release not in ['focal', 'jammy', 'noble']
|
||||||
|
|
|
||||||
|
|
@ -7,13 +7,13 @@
|
||||||
meta: end_play
|
meta: end_play
|
||||||
# TODO: figure out why Alpine does not work!
|
# TODO: figure out why Alpine does not work!
|
||||||
when: |
|
when: |
|
||||||
ansible_distribution == 'CentOS' and ansible_distribution_major_version is not version('7', '>=')
|
ansible_facts.distribution == 'CentOS' and ansible_facts.distribution_major_version is not version('7', '>=')
|
||||||
or ansible_distribution == 'Alpine'
|
or ansible_facts.distribution == 'Alpine'
|
||||||
|
|
||||||
- name: Install Nomad and test
|
- name: Install Nomad and test
|
||||||
vars:
|
vars:
|
||||||
nomad_version: 0.12.4
|
nomad_version: 0.12.4
|
||||||
nomad_uri: https://releases.hashicorp.com/nomad/{{ nomad_version }}/nomad_{{ nomad_version }}_{{ ansible_system | lower }}_{{ nomad_arch }}.zip
|
nomad_uri: https://releases.hashicorp.com/nomad/{{ nomad_version }}/nomad_{{ nomad_version }}_{{ ansible_facts.system | lower }}_{{ nomad_arch }}.zip
|
||||||
nomad_cmd: '{{ remote_tmp_dir }}/nomad'
|
nomad_cmd: '{{ remote_tmp_dir }}/nomad'
|
||||||
block:
|
block:
|
||||||
|
|
||||||
|
|
@ -23,7 +23,7 @@
|
||||||
extra_args: "-c {{ remote_constraints }}"
|
extra_args: "-c {{ remote_constraints }}"
|
||||||
register: result
|
register: result
|
||||||
until: result is success
|
until: result is success
|
||||||
when: ansible_distribution_file_variety|default() == 'RedHat' and ansible_distribution_major_version is version('6', '<=')
|
when: ansible_facts.distribution_file_variety|default() == 'RedHat' and ansible_facts.distribution_major_version is version('6', '<=')
|
||||||
|
|
||||||
- name: Install python-nomad
|
- name: Install python-nomad
|
||||||
pip:
|
pip:
|
||||||
|
|
@ -64,18 +64,18 @@
|
||||||
name: unzip
|
name: unzip
|
||||||
register: result
|
register: result
|
||||||
until: result is success
|
until: result is success
|
||||||
when: ansible_distribution != "MacOSX"
|
when: ansible_facts.distribution != "MacOSX"
|
||||||
|
|
||||||
- assert:
|
- assert:
|
||||||
that: ansible_architecture in ['i386', 'x86_64', 'amd64']
|
that: ansible_facts.architecture in ['i386', 'x86_64', 'amd64']
|
||||||
|
|
||||||
- set_fact:
|
- set_fact:
|
||||||
nomad_arch: '386'
|
nomad_arch: '386'
|
||||||
when: ansible_architecture == 'i386'
|
when: ansible_facts.architecture == 'i386'
|
||||||
|
|
||||||
- set_fact:
|
- set_fact:
|
||||||
nomad_arch: amd64
|
nomad_arch: amd64
|
||||||
when: ansible_architecture in ['x86_64', 'amd64']
|
when: ansible_facts.architecture in ['x86_64', 'amd64']
|
||||||
|
|
||||||
- name: Download nomad binary
|
- name: Download nomad binary
|
||||||
unarchive:
|
unarchive:
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@
|
||||||
# Setup steps
|
# Setup steps
|
||||||
|
|
||||||
- when:
|
- when:
|
||||||
- not (ansible_os_family == 'Alpine') # TODO
|
- not (ansible_facts.os_family == 'Alpine') # TODO
|
||||||
block:
|
block:
|
||||||
|
|
||||||
# expand remote path
|
# expand remote path
|
||||||
|
|
@ -25,7 +25,7 @@
|
||||||
- include_tasks: run.yml
|
- include_tasks: run.yml
|
||||||
vars:
|
vars:
|
||||||
nodejs_version: '{{ item }}'
|
nodejs_version: '{{ item }}'
|
||||||
nodejs_path: 'node-v{{ nodejs_version }}-{{ ansible_system|lower }}-x{{ ansible_userspace_bits }}'
|
nodejs_path: 'node-v{{ nodejs_version }}-{{ ansible_facts.system|lower }}-x{{ ansible_facts.userspace_bits }}'
|
||||||
with_items:
|
with_items:
|
||||||
- 7.10.1 # provides npm 4.2.0 (last npm < 5 released)
|
- 7.10.1 # provides npm 4.2.0 (last npm < 5 released)
|
||||||
- 8.0.0 # provides npm 5.0.0
|
- 8.0.0 # provides npm 5.0.0
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@
|
||||||
block:
|
block:
|
||||||
- shell: npm --version
|
- shell: npm --version
|
||||||
environment:
|
environment:
|
||||||
PATH: '{{ node_path }}:{{ ansible_env.PATH }}'
|
PATH: '{{ node_path }}:{{ ansible_facts.env.PATH }}'
|
||||||
register: npm_version
|
register: npm_version
|
||||||
|
|
||||||
- debug:
|
- debug:
|
||||||
|
|
@ -29,7 +29,7 @@
|
||||||
name: '{{ package }}'
|
name: '{{ package }}'
|
||||||
no_bin_links: false
|
no_bin_links: false
|
||||||
environment:
|
environment:
|
||||||
PATH: '{{ node_path }}:{{ ansible_env.PATH }}'
|
PATH: '{{ node_path }}:{{ ansible_facts.env.PATH }}'
|
||||||
register: npm_install_no_bin_links_disabled
|
register: npm_install_no_bin_links_disabled
|
||||||
|
|
||||||
- name: 'Make sure .bin folder has been created'
|
- name: 'Make sure .bin folder has been created'
|
||||||
|
|
@ -50,7 +50,7 @@
|
||||||
name: '{{ package }}'
|
name: '{{ package }}'
|
||||||
no_bin_links: true
|
no_bin_links: true
|
||||||
environment:
|
environment:
|
||||||
PATH: '{{ node_path }}:{{ ansible_env.PATH }}'
|
PATH: '{{ node_path }}:{{ ansible_facts.env.PATH }}'
|
||||||
register: npm_install_no_bin_links_enabled
|
register: npm_install_no_bin_links_enabled
|
||||||
|
|
||||||
- name: 'Make sure .bin folder has not been created'
|
- name: 'Make sure .bin folder has not been created'
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@
|
||||||
node_path: '{{ remote_dir }}/{{ nodejs_path }}/bin'
|
node_path: '{{ remote_dir }}/{{ nodejs_path }}/bin'
|
||||||
package: 'iconv-lite'
|
package: 'iconv-lite'
|
||||||
environment:
|
environment:
|
||||||
PATH: '{{ node_path }}:{{ ansible_env.PATH }}'
|
PATH: '{{ node_path }}:{{ ansible_facts.env.PATH }}'
|
||||||
block:
|
block:
|
||||||
- shell: npm --version
|
- shell: npm --version
|
||||||
register: npm_version
|
register: npm_version
|
||||||
|
|
|
||||||
|
|
@ -3,9 +3,9 @@
|
||||||
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
|
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
|
||||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
|
||||||
- name: "Install {{ ansible_os_family }} Libraries"
|
- name: "Install {{ ansible_facts.os_family }} Libraries"
|
||||||
package:
|
package:
|
||||||
name: "{{ packages[ansible_os_family] }}"
|
name: "{{ packages[ansible_facts.os_family] }}"
|
||||||
|
|
||||||
- name: "Install pyodbc"
|
- name: "Install pyodbc"
|
||||||
pip:
|
pip:
|
||||||
|
|
|
||||||
|
|
@ -9,12 +9,12 @@
|
||||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
|
||||||
- debug:
|
- debug:
|
||||||
msg: "{{ ansible_os_family }} / {{ ansible_distribution }} / {{ ansible_distribution_major_version }}"
|
msg: "{{ ansible_facts.os_family }} / {{ ansible_facts.distribution }} / {{ ansible_facts.distribution_major_version }}"
|
||||||
|
|
||||||
- when:
|
- when:
|
||||||
- ansible_os_family != 'Archlinux' # TODO install driver from AUR: https://aur.archlinux.org/packages/psqlodbc
|
- ansible_facts.os_family != 'Archlinux' # TODO install driver from AUR: https://aur.archlinux.org/packages/psqlodbc
|
||||||
- ansible_os_family != 'RedHat' or ansible_distribution_major_version != '7' # CentOS 7 stopped working
|
- ansible_facts.os_family != 'RedHat' or ansible_facts.distribution_major_version != '7' # CentOS 7 stopped working
|
||||||
- ansible_distribution != 'Debian' or ansible_distribution_major_version != '13' # TODO fix tests for Debian 13 (Trixie)!
|
- ansible_facts.distribution != 'Debian' or ansible_facts.distribution_major_version != '13' # TODO fix tests for Debian 13 (Trixie)!
|
||||||
block:
|
block:
|
||||||
|
|
||||||
#
|
#
|
||||||
|
|
@ -22,7 +22,7 @@
|
||||||
#
|
#
|
||||||
# Some of the docker images already have pyodbc installed on it
|
# Some of the docker images already have pyodbc installed on it
|
||||||
- include_tasks: no_pyodbc.yml
|
- include_tasks: no_pyodbc.yml
|
||||||
when: ansible_os_family != 'FreeBSD' and ansible_os_family != 'Suse' and ansible_os_family != 'Debian'
|
when: ansible_facts.os_family != 'FreeBSD' and ansible_facts.os_family != 'Suse' and ansible_facts.os_family != 'Debian'
|
||||||
|
|
||||||
#
|
#
|
||||||
# Get pyodbc installed
|
# Get pyodbc installed
|
||||||
|
|
@ -40,17 +40,17 @@
|
||||||
- name: Changing DSN for Suse
|
- name: Changing DSN for Suse
|
||||||
set_fact:
|
set_fact:
|
||||||
dsn: "DRIVER={PSQL};Server=localhost;Port=5432;Database=postgres;Uid={{ my_user }};Pwd={{ my_pass_decrypted }};UseUnicode=True"
|
dsn: "DRIVER={PSQL};Server=localhost;Port=5432;Database=postgres;Uid={{ my_user }};Pwd={{ my_pass_decrypted }};UseUnicode=True"
|
||||||
when: ansible_os_family == 'Suse' or ansible_os_family == 'Alpine'
|
when: ansible_facts.os_family == 'Suse' or ansible_facts.os_family == 'Alpine'
|
||||||
|
|
||||||
- name: Changing DSN for Alpine
|
- name: Changing DSN for Alpine
|
||||||
set_fact:
|
set_fact:
|
||||||
dsn: "DRIVER={/usr/lib/psqlodbcw.so};Server=localhost;Port=5432;Database=postgres;Uid={{ my_user }};Pwd={{ my_pass_decrypted }};UseUnicode=True"
|
dsn: "DRIVER={/usr/lib/psqlodbcw.so};Server=localhost;Port=5432;Database=postgres;Uid={{ my_user }};Pwd={{ my_pass_decrypted }};UseUnicode=True"
|
||||||
when: ansible_os_family == 'Alpine'
|
when: ansible_facts.os_family == 'Alpine'
|
||||||
|
|
||||||
- name: Changing DSN for Debian
|
- name: Changing DSN for Debian
|
||||||
set_fact:
|
set_fact:
|
||||||
dsn: "DRIVER={PostgreSQL Unicode};Server=localhost;Port=5432;Database=postgres;Uid={{ my_user }};Pwd={{ my_pass_decrypted }};UseUnicode=True"
|
dsn: "DRIVER={PostgreSQL Unicode};Server=localhost;Port=5432;Database=postgres;Uid={{ my_user }};Pwd={{ my_pass_decrypted }};UseUnicode=True"
|
||||||
when: ansible_os_family == 'Debian'
|
when: ansible_facts.os_family == 'Debian'
|
||||||
|
|
||||||
#
|
#
|
||||||
# Name setup database
|
# Name setup database
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@
|
||||||
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
|
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
|
||||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
|
||||||
- when: ansible_os_family == 'Archlinux'
|
- when: ansible_facts.os_family == 'Archlinux'
|
||||||
block:
|
block:
|
||||||
# Add more tests here by including more task files:
|
# Add more tests here by including more task files:
|
||||||
- include_tasks: 'basic.yml'
|
- include_tasks: 'basic.yml'
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@
|
||||||
package:
|
package:
|
||||||
name: parted
|
name: parted
|
||||||
state: present
|
state: present
|
||||||
when: ansible_os_family == 'Alpine'
|
when: ansible_facts.os_family == 'Alpine'
|
||||||
|
|
||||||
- name: Create empty file
|
- name: Create empty file
|
||||||
community.general.filesize:
|
community.general.filesize:
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@
|
||||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
|
||||||
- name: Bail out if Python < 3.8
|
- name: Bail out if Python < 3.8
|
||||||
when: ansible_python_version is version('3.8', '<')
|
when: ansible_facts.python_version is version('3.8', '<')
|
||||||
ansible.builtin.meta: end_play
|
ansible.builtin.meta: end_play
|
||||||
- name: Install pipx>=1.7.0
|
- name: Install pipx>=1.7.0
|
||||||
ansible.builtin.pip:
|
ansible.builtin.pip:
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
|
|
||||||
- name: Set up environment
|
- name: Set up environment
|
||||||
environment:
|
environment:
|
||||||
PATH: /root/.local/bin:/usr/local/bin:{{ ansible_env.PATH }}
|
PATH: /root/.local/bin:/usr/local/bin:{{ ansible_facts.env.PATH }}
|
||||||
block:
|
block:
|
||||||
- name: Remove global pipx dir
|
- name: Remove global pipx dir
|
||||||
ansible.builtin.file:
|
ansible.builtin.file:
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
|
|
||||||
- name: Set up environment
|
- name: Set up environment
|
||||||
environment:
|
environment:
|
||||||
PATH: /usr/local/bin:{{ ansible_env.PATH }}
|
PATH: /usr/local/bin:{{ ansible_facts.env.PATH }}
|
||||||
block:
|
block:
|
||||||
- name: Uninstall pycowsay and black
|
- name: Uninstall pycowsay and black
|
||||||
community.general.pipx:
|
community.general.pipx:
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
|
|
||||||
- name: Set up environment
|
- name: Set up environment
|
||||||
environment:
|
environment:
|
||||||
PATH: /usr/local/bin:{{ ansible_env.PATH }}
|
PATH: /usr/local/bin:{{ ansible_facts.env.PATH }}
|
||||||
block:
|
block:
|
||||||
- name: Uninstall pycowsay and black
|
- name: Uninstall pycowsay and black
|
||||||
community.general.pipx:
|
community.general.pipx:
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
|
|
||||||
- name: Set up environment
|
- name: Set up environment
|
||||||
environment:
|
environment:
|
||||||
PATH: /usr/local/bin:{{ ansible_env.PATH }}
|
PATH: /usr/local/bin:{{ ansible_facts.env.PATH }}
|
||||||
block:
|
block:
|
||||||
- name: Uninstall pycowsay
|
- name: Uninstall pycowsay
|
||||||
community.general.pipx:
|
community.general.pipx:
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@
|
||||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
|
||||||
- name: Bail out if Python < 3.8
|
- name: Bail out if Python < 3.8
|
||||||
when: ansible_python_version is version('3.8', '<')
|
when: ansible_facts.python_version is version('3.8', '<')
|
||||||
ansible.builtin.meta: end_play
|
ansible.builtin.meta: end_play
|
||||||
- name: Install pipx>=1.7.0
|
- name: Install pipx>=1.7.0
|
||||||
ansible.builtin.pip:
|
ansible.builtin.pip:
|
||||||
|
|
|
||||||
|
|
@ -267,7 +267,7 @@
|
||||||
# NOTE: FreeBSD 12.0 test runner receives a "connection reset by peer" after ~20% downloaded so we are
|
# NOTE: FreeBSD 12.0 test runner receives a "connection reset by peer" after ~20% downloaded so we are
|
||||||
# only running this on 12.1 or higher
|
# only running this on 12.1 or higher
|
||||||
#
|
#
|
||||||
when: ansible_distribution_version is version('12.01', '>=')
|
when: ansible_facts.distribution_version is version('12.01', '>=')
|
||||||
block:
|
block:
|
||||||
- name: Install GNU autotools
|
- name: Install GNU autotools
|
||||||
pkgng:
|
pkgng:
|
||||||
|
|
@ -539,9 +539,9 @@
|
||||||
# See also
|
# See also
|
||||||
# https://github.com/ansible-collections/community.general/issues/5795
|
# https://github.com/ansible-collections/community.general/issues/5795
|
||||||
when: >-
|
when: >-
|
||||||
(ansible_distribution_version is version('12.01', '>=') and ansible_distribution_version is version('12.3', '<'))
|
(ansible_facts.distribution_version is version('12.01', '>=') and ansible_facts.distribution_version is version('12.3', '<'))
|
||||||
or (ansible_distribution_version is version('13.6', '>=') and ansible_distribution_version is version('14.0', '<'))
|
or (ansible_facts.distribution_version is version('13.6', '>=') and ansible_facts.distribution_version is version('14.0', '<'))
|
||||||
or ansible_distribution_version is version('14.4', '>=')
|
or ansible_facts.distribution_version is version('14.4', '>=')
|
||||||
block:
|
block:
|
||||||
- name: Setup testjail
|
- name: Setup testjail
|
||||||
include_tasks: setup-testjail.yml
|
include_tasks: setup-testjail.yml
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@
|
||||||
copy:
|
copy:
|
||||||
dest: /etc/pf.conf
|
dest: /etc/pf.conf
|
||||||
content: |
|
content: |
|
||||||
nat on {{ ansible_default_ipv4.interface }} from 127.0.1.0/24 -> {{ ansible_default_ipv4.interface }}:0
|
nat on {{ ansible_facts.default_ipv4.interface }} from 127.0.1.0/24 -> {{ ansible_facts.default_ipv4.interface }}:0
|
||||||
validate: "pfctl -nf %s"
|
validate: "pfctl -nf %s"
|
||||||
|
|
||||||
- name: Start pf firewall
|
- name: Start pf firewall
|
||||||
|
|
@ -35,14 +35,14 @@
|
||||||
name: ezjail
|
name: ezjail
|
||||||
|
|
||||||
- name: Configure ezjail to use http
|
- name: Configure ezjail to use http
|
||||||
when: ansible_distribution_version is version('11.01', '>')
|
when: ansible_facts.distribution_version is version('11.01', '>')
|
||||||
lineinfile:
|
lineinfile:
|
||||||
dest: /usr/local/etc/ezjail.conf
|
dest: /usr/local/etc/ezjail.conf
|
||||||
regexp: ^ezjail_ftphost
|
regexp: ^ezjail_ftphost
|
||||||
line: ezjail_ftphost=http://ftp.freebsd.org
|
line: ezjail_ftphost=http://ftp.freebsd.org
|
||||||
|
|
||||||
- name: Configure ezjail to use archive for old freebsd releases
|
- name: Configure ezjail to use archive for old freebsd releases
|
||||||
when: ansible_distribution_version is version('11.01', '<=')
|
when: ansible_facts.distribution_version is version('11.01', '<=')
|
||||||
lineinfile:
|
lineinfile:
|
||||||
dest: /usr/local/etc/ezjail.conf
|
dest: /usr/local/etc/ezjail.conf
|
||||||
regexp: ^ezjail_ftphost
|
regexp: ^ezjail_ftphost
|
||||||
|
|
|
||||||
|
|
@ -16,12 +16,12 @@
|
||||||
- name: Run tests on OSes
|
- name: Run tests on OSes
|
||||||
ansible.builtin.include_tasks: run.yml
|
ansible.builtin.include_tasks: run.yml
|
||||||
vars:
|
vars:
|
||||||
ansible_system_os: "{{ ansible_system | lower }}"
|
ansible_system_os: "{{ ansible_facts.system | lower }}"
|
||||||
nodejs_version: "{{ item.node_version }}"
|
nodejs_version: "{{ item.node_version }}"
|
||||||
nodejs_path: "node-v{{ nodejs_version }}-{{ ansible_system_os }}-x{{ ansible_userspace_bits }}"
|
nodejs_path: "node-v{{ nodejs_version }}-{{ ansible_system_os }}-x{{ ansible_facts.userspace_bits }}"
|
||||||
pnpm_version: "{{ item.pnpm_version }}"
|
pnpm_version: "{{ item.pnpm_version }}"
|
||||||
pnpm_path: "pnpm-{{ 'macos' if ansible_system_os == 'darwin' else 'linuxstatic' }}-x{{ ansible_userspace_bits }}"
|
pnpm_path: "pnpm-{{ 'macos' if ansible_system_os == 'darwin' else 'linuxstatic' }}-x{{ ansible_facts.userspace_bits }}"
|
||||||
with_items:
|
with_items:
|
||||||
- { node_version: 16.20.0, pnpm_version: 8.7.0 }
|
- { node_version: 16.20.0, pnpm_version: 8.7.0 }
|
||||||
when:
|
when:
|
||||||
- not(ansible_distribution == 'Alpine') and not(ansible_distribution == 'CentOS' and ansible_distribution_major_version == '6')
|
- not(ansible_facts.distribution == 'Alpine') and not(ansible_facts.distribution == 'CentOS' and ansible_facts.distribution_major_version == '6')
|
||||||
|
|
|
||||||
|
|
@ -25,9 +25,9 @@
|
||||||
- name: Setting up pnpm via command
|
- name: Setting up pnpm via command
|
||||||
ansible.builtin.command: "{{ tmp_dir.path }}/pnpm setup --force"
|
ansible.builtin.command: "{{ tmp_dir.path }}/pnpm setup --force"
|
||||||
environment:
|
environment:
|
||||||
PNPM_HOME: "{{ ansible_env.HOME }}/.local/share/pnpm"
|
PNPM_HOME: "{{ ansible_facts.env.HOME }}/.local/share/pnpm"
|
||||||
SHELL: /bin/sh
|
SHELL: /bin/sh
|
||||||
ENV: "{{ ansible_env.HOME }}/.shrc"
|
ENV: "{{ ansible_facts.env.HOME }}/.shrc"
|
||||||
|
|
||||||
- name: Remove the temporary directory
|
- name: Remove the temporary directory
|
||||||
ansible.builtin.file:
|
ansible.builtin.file:
|
||||||
|
|
@ -42,10 +42,10 @@
|
||||||
- name: CI tests to run
|
- name: CI tests to run
|
||||||
vars:
|
vars:
|
||||||
node_bin_path: "{{ remote_tmp_dir }}/{{ nodejs_path }}/bin"
|
node_bin_path: "{{ remote_tmp_dir }}/{{ nodejs_path }}/bin"
|
||||||
pnpm_bin_path: "{{ ansible_env.HOME }}/.local/share/pnpm"
|
pnpm_bin_path: "{{ ansible_facts.env.HOME }}/.local/share/pnpm"
|
||||||
package: "tailwindcss"
|
package: "tailwindcss"
|
||||||
environment:
|
environment:
|
||||||
PATH: "{{ node_bin_path }}:{{ ansible_env.PATH }}"
|
PATH: "{{ node_bin_path }}:{{ ansible_facts.env.PATH }}"
|
||||||
|
|
||||||
block:
|
block:
|
||||||
- name: Create dummy package.json
|
- name: Create dummy package.json
|
||||||
|
|
@ -60,7 +60,7 @@
|
||||||
executable: "{{ pnpm_bin_path }}/pnpm"
|
executable: "{{ pnpm_bin_path }}/pnpm"
|
||||||
state: present
|
state: present
|
||||||
environment:
|
environment:
|
||||||
PATH: "{{ node_bin_path }}:{{ ansible_env.PATH }}"
|
PATH: "{{ node_bin_path }}:{{ ansible_facts.env.PATH }}"
|
||||||
|
|
||||||
- name: Install the same package from package.json again
|
- name: Install the same package from package.json again
|
||||||
pnpm:
|
pnpm:
|
||||||
|
|
@ -69,7 +69,7 @@
|
||||||
name: "reading-time"
|
name: "reading-time"
|
||||||
state: present
|
state: present
|
||||||
environment:
|
environment:
|
||||||
PATH: "{{ node_bin_path }}:{{ ansible_env.PATH }}"
|
PATH: "{{ node_bin_path }}:{{ ansible_facts.env.PATH }}"
|
||||||
register: pnpm_install
|
register: pnpm_install
|
||||||
|
|
||||||
- name: Assert that result is not changed
|
- name: Assert that result is not changed
|
||||||
|
|
@ -83,7 +83,7 @@
|
||||||
executable: "{{ pnpm_bin_path }}/pnpm"
|
executable: "{{ pnpm_bin_path }}/pnpm"
|
||||||
state: present
|
state: present
|
||||||
environment:
|
environment:
|
||||||
PATH: "{{ node_bin_path }}:{{ ansible_env.PATH }}"
|
PATH: "{{ node_bin_path }}:{{ ansible_facts.env.PATH }}"
|
||||||
check_mode: true
|
check_mode: true
|
||||||
register: pnpm_install_check
|
register: pnpm_install_check
|
||||||
|
|
||||||
|
|
@ -102,7 +102,7 @@
|
||||||
state: present
|
state: present
|
||||||
name: "{{ package }}"
|
name: "{{ package }}"
|
||||||
environment:
|
environment:
|
||||||
PATH: "{{ node_bin_path }}:{{ ansible_env.PATH }}"
|
PATH: "{{ node_bin_path }}:{{ ansible_facts.env.PATH }}"
|
||||||
register: pnpm_install
|
register: pnpm_install
|
||||||
|
|
||||||
- name: Assert that result is changed and successful
|
- name: Assert that result is changed and successful
|
||||||
|
|
@ -118,7 +118,7 @@
|
||||||
state: present
|
state: present
|
||||||
name: "{{ package }}"
|
name: "{{ package }}"
|
||||||
environment:
|
environment:
|
||||||
PATH: "{{ node_bin_path }}:{{ ansible_env.PATH }}"
|
PATH: "{{ node_bin_path }}:{{ ansible_facts.env.PATH }}"
|
||||||
register: pnpm_reinstall
|
register: pnpm_reinstall
|
||||||
|
|
||||||
- name: Assert that there is no change
|
- name: Assert that there is no change
|
||||||
|
|
@ -134,7 +134,7 @@
|
||||||
state: latest
|
state: latest
|
||||||
name: "{{ package }}"
|
name: "{{ package }}"
|
||||||
environment:
|
environment:
|
||||||
PATH: "{{ node_bin_path }}:{{ ansible_env.PATH }}"
|
PATH: "{{ node_bin_path }}:{{ ansible_facts.env.PATH }}"
|
||||||
register: pnpm_fix_install
|
register: pnpm_fix_install
|
||||||
|
|
||||||
- name: Assert that result is changed and successful
|
- name: Assert that result is changed and successful
|
||||||
|
|
@ -150,7 +150,7 @@
|
||||||
path: "{{ remote_tmp_dir }}"
|
path: "{{ remote_tmp_dir }}"
|
||||||
state: present
|
state: present
|
||||||
environment:
|
environment:
|
||||||
PATH: "{{ pnpm_bin_path }}:{{ node_bin_path }}:{{ ansible_env.PATH }}"
|
PATH: "{{ pnpm_bin_path }}:{{ node_bin_path }}:{{ ansible_facts.env.PATH }}"
|
||||||
register: pnpm_install
|
register: pnpm_install
|
||||||
|
|
||||||
- name: Assert that package with version is installed
|
- name: Assert that package with version is installed
|
||||||
|
|
@ -166,7 +166,7 @@
|
||||||
path: "{{ remote_tmp_dir }}"
|
path: "{{ remote_tmp_dir }}"
|
||||||
state: present
|
state: present
|
||||||
environment:
|
environment:
|
||||||
PATH: "{{ pnpm_bin_path }}:{{ node_bin_path }}:{{ ansible_env.PATH }}"
|
PATH: "{{ pnpm_bin_path }}:{{ node_bin_path }}:{{ ansible_facts.env.PATH }}"
|
||||||
register: pnpm_reinstall
|
register: pnpm_reinstall
|
||||||
|
|
||||||
- name: Assert that there is no change
|
- name: Assert that there is no change
|
||||||
|
|
@ -181,7 +181,7 @@
|
||||||
path: "{{ remote_tmp_dir }}"
|
path: "{{ remote_tmp_dir }}"
|
||||||
state: latest
|
state: latest
|
||||||
environment:
|
environment:
|
||||||
PATH: "{{ pnpm_bin_path }}:{{ node_bin_path }}:{{ ansible_env.PATH }}"
|
PATH: "{{ pnpm_bin_path }}:{{ node_bin_path }}:{{ ansible_facts.env.PATH }}"
|
||||||
register: pnpm_update
|
register: pnpm_update
|
||||||
|
|
||||||
- name: Assert that result is changed and successful
|
- name: Assert that result is changed and successful
|
||||||
|
|
@ -196,7 +196,7 @@
|
||||||
path: "{{ remote_tmp_dir }}"
|
path: "{{ remote_tmp_dir }}"
|
||||||
state: absent
|
state: absent
|
||||||
environment:
|
environment:
|
||||||
PATH: "{{ pnpm_bin_path }}:{{ node_bin_path }}:{{ ansible_env.PATH }}"
|
PATH: "{{ pnpm_bin_path }}:{{ node_bin_path }}:{{ ansible_facts.env.PATH }}"
|
||||||
register: pnpm_absent
|
register: pnpm_absent
|
||||||
|
|
||||||
- name: Assert that result is changed and successful
|
- name: Assert that result is changed and successful
|
||||||
|
|
@ -213,7 +213,7 @@
|
||||||
path: "{{ remote_tmp_dir }}"
|
path: "{{ remote_tmp_dir }}"
|
||||||
state: present
|
state: present
|
||||||
environment:
|
environment:
|
||||||
PATH: "{{ pnpm_bin_path }}:{{ node_bin_path }}:{{ ansible_env.PATH }}"
|
PATH: "{{ pnpm_bin_path }}:{{ node_bin_path }}:{{ ansible_facts.env.PATH }}"
|
||||||
register: pnpm_install
|
register: pnpm_install
|
||||||
|
|
||||||
- name: Assert that package with version and alias is installed
|
- name: Assert that package with version and alias is installed
|
||||||
|
|
@ -230,7 +230,7 @@
|
||||||
path: "{{ remote_tmp_dir }}"
|
path: "{{ remote_tmp_dir }}"
|
||||||
state: present
|
state: present
|
||||||
environment:
|
environment:
|
||||||
PATH: "{{ pnpm_bin_path }}:{{ node_bin_path }}:{{ ansible_env.PATH }}"
|
PATH: "{{ pnpm_bin_path }}:{{ node_bin_path }}:{{ ansible_facts.env.PATH }}"
|
||||||
register: pnpm_reinstall
|
register: pnpm_reinstall
|
||||||
|
|
||||||
- name: Assert that there is no change
|
- name: Assert that there is no change
|
||||||
|
|
@ -246,7 +246,7 @@
|
||||||
path: "{{ remote_tmp_dir }}"
|
path: "{{ remote_tmp_dir }}"
|
||||||
state: absent
|
state: absent
|
||||||
environment:
|
environment:
|
||||||
PATH: "{{ pnpm_bin_path }}:{{ node_bin_path }}:{{ ansible_env.PATH }}"
|
PATH: "{{ pnpm_bin_path }}:{{ node_bin_path }}:{{ ansible_facts.env.PATH }}"
|
||||||
register: pnpm_absent
|
register: pnpm_absent
|
||||||
|
|
||||||
- name: Assert that result is changed and successful
|
- name: Assert that result is changed and successful
|
||||||
|
|
@ -262,7 +262,7 @@
|
||||||
state: present
|
state: present
|
||||||
global: true
|
global: true
|
||||||
environment:
|
environment:
|
||||||
PATH: "{{ pnpm_bin_path }}:{{ node_bin_path }}:{{ ansible_env.PATH }}"
|
PATH: "{{ pnpm_bin_path }}:{{ node_bin_path }}:{{ ansible_facts.env.PATH }}"
|
||||||
PNPM_HOME: "{{ pnpm_bin_path }}"
|
PNPM_HOME: "{{ pnpm_bin_path }}"
|
||||||
register: pnpm_install
|
register: pnpm_install
|
||||||
|
|
||||||
|
|
@ -278,7 +278,7 @@
|
||||||
state: present
|
state: present
|
||||||
global: true
|
global: true
|
||||||
environment:
|
environment:
|
||||||
PATH: "{{ pnpm_bin_path }}:{{ node_bin_path }}:{{ ansible_env.PATH }}"
|
PATH: "{{ pnpm_bin_path }}:{{ node_bin_path }}:{{ ansible_facts.env.PATH }}"
|
||||||
PNPM_HOME: "{{ pnpm_bin_path }}"
|
PNPM_HOME: "{{ pnpm_bin_path }}"
|
||||||
register: pnpm_reinstall
|
register: pnpm_reinstall
|
||||||
|
|
||||||
|
|
@ -294,7 +294,7 @@
|
||||||
state: latest
|
state: latest
|
||||||
global: true
|
global: true
|
||||||
environment:
|
environment:
|
||||||
PATH: "{{ pnpm_bin_path }}:{{ node_bin_path }}:{{ ansible_env.PATH }}"
|
PATH: "{{ pnpm_bin_path }}:{{ node_bin_path }}:{{ ansible_facts.env.PATH }}"
|
||||||
PNPM_HOME: "{{ pnpm_bin_path }}"
|
PNPM_HOME: "{{ pnpm_bin_path }}"
|
||||||
register: pnpm_reinstall
|
register: pnpm_reinstall
|
||||||
|
|
||||||
|
|
@ -311,7 +311,7 @@
|
||||||
global: true
|
global: true
|
||||||
state: absent
|
state: absent
|
||||||
environment:
|
environment:
|
||||||
PATH: "{{ pnpm_bin_path }}:{{ node_bin_path }}:{{ ansible_env.PATH }}"
|
PATH: "{{ pnpm_bin_path }}:{{ node_bin_path }}:{{ ansible_facts.env.PATH }}"
|
||||||
PNPM_HOME: "{{ pnpm_bin_path }}"
|
PNPM_HOME: "{{ pnpm_bin_path }}"
|
||||||
register: pnpm_absent
|
register: pnpm_absent
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@
|
||||||
pip:
|
pip:
|
||||||
name: setuptools
|
name: setuptools
|
||||||
state: present
|
state: present
|
||||||
when: ansible_facts.distribution == 'MacOSX' and ansible_distribution_version is version('15', '>=')
|
when: ansible_facts.distribution == 'MacOSX' and ansible_facts.distribution_version is version('15', '>=')
|
||||||
|
|
||||||
- name: run python_requirements_info module
|
- name: run python_requirements_info module
|
||||||
python_requirements_info:
|
python_requirements_info:
|
||||||
|
|
@ -23,7 +23,7 @@
|
||||||
that:
|
that:
|
||||||
- "'python' in basic_info"
|
- "'python' in basic_info"
|
||||||
- "'python_version' in basic_info"
|
- "'python_version' in basic_info"
|
||||||
- basic_info.python_version_info == ansible_python.version
|
- basic_info.python_version_info == ansible_facts.python.version
|
||||||
|
|
||||||
- name: run python_requirements_info module
|
- name: run python_requirements_info module
|
||||||
python_requirements_info:
|
python_requirements_info:
|
||||||
|
|
|
||||||
|
|
@ -8,14 +8,14 @@
|
||||||
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
|
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
|
||||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
|
||||||
# FIXME: Unfortunately ansible_selinux could be a boolean or a dictionary !
|
# FIXME: Unfortunately ansible_facts.selinux could be a boolean or a dictionary !
|
||||||
- debug:
|
- debug:
|
||||||
msg: SELinux is disabled
|
msg: SELinux is disabled
|
||||||
when: ansible_selinux is defined and ansible_selinux == False
|
when: ansible_facts.selinux is defined and ansible_facts.selinux == False
|
||||||
|
|
||||||
- debug:
|
- debug:
|
||||||
msg: SELinux is {{ ansible_selinux.status }}
|
msg: SELinux is {{ ansible_facts.selinux.status }}
|
||||||
when: ansible_selinux is defined and ansible_selinux != False
|
when: ansible_facts.selinux is defined and ansible_facts.selinux != False
|
||||||
|
|
||||||
- include_tasks: sefcontext.yml
|
- include_tasks: sefcontext.yml
|
||||||
when: ansible_selinux is defined and ansible_selinux != False and ansible_selinux.status == 'enabled'
|
when: ansible_facts.selinux is defined and ansible_facts.selinux != False and ansible_facts.selinux.status == 'enabled'
|
||||||
|
|
|
||||||
|
|
@ -7,15 +7,15 @@
|
||||||
package:
|
package:
|
||||||
name: policycoreutils-python
|
name: policycoreutils-python
|
||||||
when:
|
when:
|
||||||
- ansible_distribution == 'RedHat'
|
- ansible_facts.distribution == 'RedHat'
|
||||||
- ansible_distribution_major_version|int < 8
|
- ansible_facts.distribution_major_version|int < 8
|
||||||
|
|
||||||
- name: install requirements for rhel8 beta
|
- name: install requirements for rhel8 beta
|
||||||
package:
|
package:
|
||||||
name: python3-policycoreutils
|
name: python3-policycoreutils
|
||||||
when:
|
when:
|
||||||
- ansible_distribution == 'RedHat'
|
- ansible_facts.distribution == 'RedHat'
|
||||||
- ansible_distribution_major_version|int >= 8
|
- ansible_facts.distribution_major_version|int >= 8
|
||||||
|
|
||||||
- name: Ensure we start with a clean state
|
- name: Ensure we start with a clean state
|
||||||
sefcontext:
|
sefcontext:
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@
|
||||||
apt:
|
apt:
|
||||||
name: "{{item}}"
|
name: "{{item}}"
|
||||||
state: present
|
state: present
|
||||||
when: "ansible_os_family == 'Debian'"
|
when: "ansible_facts.os_family == 'Debian'"
|
||||||
with_items:
|
with_items:
|
||||||
- apache2
|
- apache2
|
||||||
- libapache2-mod-evasive
|
- libapache2-mod-evasive
|
||||||
|
|
@ -21,10 +21,10 @@
|
||||||
community.general.zypper:
|
community.general.zypper:
|
||||||
name: apache2
|
name: apache2
|
||||||
state: present
|
state: present
|
||||||
when: "ansible_os_family == 'Suse'"
|
when: "ansible_facts.os_family == 'Suse'"
|
||||||
|
|
||||||
- name: Enable mod_slotmem_shm on SuSE
|
- name: Enable mod_slotmem_shm on SuSE
|
||||||
apache2_module:
|
apache2_module:
|
||||||
name: slotmem_shm
|
name: slotmem_shm
|
||||||
state: present
|
state: present
|
||||||
when: "ansible_os_family == 'Suse'"
|
when: "ansible_facts.os_family == 'Suse'"
|
||||||
|
|
|
||||||
|
|
@ -9,16 +9,16 @@
|
||||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
|
||||||
- when:
|
- when:
|
||||||
- not (ansible_os_family == 'Alpine' and ansible_distribution_version is version('3.15', '<')) # TODO
|
- not (ansible_facts.os_family == 'Alpine' and ansible_facts.distribution_version is version('3.15', '<')) # TODO
|
||||||
block:
|
block:
|
||||||
- name: Include distribution specific variables
|
- name: Include distribution specific variables
|
||||||
include_vars: '{{ lookup(''first_found'', search) }}'
|
include_vars: '{{ lookup(''first_found'', search) }}'
|
||||||
vars:
|
vars:
|
||||||
search:
|
search:
|
||||||
files:
|
files:
|
||||||
- '{{ ansible_distribution | lower }}.yml'
|
- '{{ ansible_facts.distribution | lower }}.yml'
|
||||||
- '{{ ansible_os_family | lower }}.yml'
|
- '{{ ansible_facts.os_family | lower }}.yml'
|
||||||
- '{{ ansible_system | lower }}.yml'
|
- '{{ ansible_facts.system | lower }}.yml'
|
||||||
- default.yml
|
- default.yml
|
||||||
paths:
|
paths:
|
||||||
- vars
|
- vars
|
||||||
|
|
@ -38,7 +38,7 @@
|
||||||
- name: Find libfaketime path
|
- name: Find libfaketime path
|
||||||
shell: '{{ list_pkg_files }} {{ faketime_pkg }} | grep -F libfaketime.so.1'
|
shell: '{{ list_pkg_files }} {{ faketime_pkg }} | grep -F libfaketime.so.1'
|
||||||
register: libfaketime_path
|
register: libfaketime_path
|
||||||
- when: ansible_service_mgr == 'systemd'
|
- when: ansible_facts.service_mgr == 'systemd'
|
||||||
block:
|
block:
|
||||||
- name: create directory for cron drop-in file
|
- name: create directory for cron drop-in file
|
||||||
file:
|
file:
|
||||||
|
|
@ -60,7 +60,7 @@
|
||||||
owner: root
|
owner: root
|
||||||
group: root
|
group: root
|
||||||
mode: '0644'
|
mode: '0644'
|
||||||
- when: ansible_system == 'FreeBSD'
|
- when: ansible_facts.system == 'FreeBSD'
|
||||||
name: Use faketime with cron service
|
name: Use faketime with cron service
|
||||||
copy:
|
copy:
|
||||||
content: cron_env='LD_PRELOAD={{ libfaketime_path.stdout_lines[0].strip() }} FAKETIME="+0y x10"'
|
content: cron_env='LD_PRELOAD={{ libfaketime_path.stdout_lines[0].strip() }} FAKETIME="+0y x10"'
|
||||||
|
|
@ -70,6 +70,6 @@
|
||||||
mode: '0644'
|
mode: '0644'
|
||||||
- name: enable cron service
|
- name: enable cron service
|
||||||
service:
|
service:
|
||||||
daemon-reload: '{{ (ansible_service_mgr == ''systemd'') | ternary(true, omit) }}'
|
daemon-reload: '{{ (ansible_facts.service_mgr == ''systemd'') | ternary(true, omit) }}'
|
||||||
name: '{{ cron_service }}'
|
name: '{{ cron_service }}'
|
||||||
state: restarted
|
state: restarted
|
||||||
|
|
|
||||||
|
|
@ -16,8 +16,8 @@
|
||||||
include_role:
|
include_role:
|
||||||
name: setup_epel
|
name: setup_epel
|
||||||
when:
|
when:
|
||||||
- ansible_distribution in ['RedHat', 'CentOS']
|
- ansible_facts.distribution in ['RedHat', 'CentOS']
|
||||||
- ansible_distribution_major_version is version('9', '<')
|
- ansible_facts.distribution_major_version is version('9', '<')
|
||||||
|
|
||||||
- name: Distribution specific
|
- name: Distribution specific
|
||||||
block:
|
block:
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@
|
||||||
|
|
||||||
- name: Install EPEL
|
- name: Install EPEL
|
||||||
yum:
|
yum:
|
||||||
name: https://s3.amazonaws.com/ansible-ci-files/test/integration/targets/setup_epel/epel-release-latest-{{ ansible_distribution_major_version }}.noarch.rpm
|
name: https://s3.amazonaws.com/ansible-ci-files/test/integration/targets/setup_epel/epel-release-latest-{{ ansible_facts.distribution_major_version }}.noarch.rpm
|
||||||
disable_gpg_check: true
|
disable_gpg_check: true
|
||||||
when:
|
when:
|
||||||
- ansible_facts.distribution in ['RedHat', 'CentOS']
|
- ansible_facts.distribution in ['RedHat', 'CentOS']
|
||||||
|
|
@ -18,7 +18,7 @@
|
||||||
|
|
||||||
- name: Install EPEL
|
- name: Install EPEL
|
||||||
yum:
|
yum:
|
||||||
name: https://ci-files.testing.ansible.com/test/integration/targets/setup_epel/epel-release-latest-{{ ansible_distribution_major_version }}.noarch.rpm
|
name: https://ci-files.testing.ansible.com/test/integration/targets/setup_epel/epel-release-latest-{{ ansible_facts.distribution_major_version }}.noarch.rpm
|
||||||
disable_gpg_check: true
|
disable_gpg_check: true
|
||||||
when:
|
when:
|
||||||
- ansible_facts.distribution in ['RedHat', 'CentOS']
|
- ansible_facts.distribution in ['RedHat', 'CentOS']
|
||||||
|
|
|
||||||
|
|
@ -18,10 +18,10 @@
|
||||||
- include_vars: '{{ item }}'
|
- include_vars: '{{ item }}'
|
||||||
with_first_found:
|
with_first_found:
|
||||||
- files:
|
- files:
|
||||||
- '{{ ansible_distribution }}-{{ ansible_distribution_major_version }}.yml'
|
- '{{ ansible_facts.distribution }}-{{ ansible_facts.distribution_major_version }}.yml'
|
||||||
- '{{ ansible_distribution }}-{{ ansible_distribution_version }}.yml'
|
- '{{ ansible_facts.distribution }}-{{ ansible_facts.distribution_version }}.yml'
|
||||||
- '{{ ansible_os_family }}-{{ ansible_distribution_major_version }}.yml'
|
- '{{ ansible_facts.os_family }}-{{ ansible_facts.distribution_major_version }}.yml'
|
||||||
- '{{ ansible_os_family }}.yml'
|
- '{{ ansible_facts.os_family }}.yml'
|
||||||
- 'default.yml'
|
- 'default.yml'
|
||||||
paths: '../vars'
|
paths: '../vars'
|
||||||
|
|
||||||
|
|
@ -90,4 +90,4 @@
|
||||||
- _testetcd3ctl.rc != 0
|
- _testetcd3ctl.rc != 0
|
||||||
|
|
||||||
when:
|
when:
|
||||||
- ansible_distribution | lower ~ "-" ~ ansible_distribution_major_version | lower != 'centos-6'
|
- ansible_facts.distribution | lower ~ "-" ~ ansible_facts.distribution_major_version | lower != 'centos-6'
|
||||||
|
|
|
||||||
|
|
@ -10,8 +10,8 @@
|
||||||
|
|
||||||
- name: Set up dummy flatpak repository remote
|
- name: Set up dummy flatpak repository remote
|
||||||
when: |
|
when: |
|
||||||
ansible_distribution == 'Fedora' or
|
ansible_facts.distribution == 'Fedora' or
|
||||||
ansible_distribution == 'Ubuntu' and not ansible_distribution_major_version | int < 16
|
ansible_facts.distribution == 'Ubuntu' and not ansible_facts.distribution_major_version | int < 16
|
||||||
block:
|
block:
|
||||||
- name: Copy repo into place
|
- name: Copy repo into place
|
||||||
unarchive:
|
unarchive:
|
||||||
|
|
|
||||||
|
|
@ -9,4 +9,4 @@
|
||||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
|
||||||
- include_tasks: setup.yml
|
- include_tasks: setup.yml
|
||||||
when: ansible_distribution == 'Ubuntu' and ansible_distribution_release == 'trusty'
|
when: ansible_facts.distribution == 'Ubuntu' and ansible_facts.distribution_release == 'trusty'
|
||||||
|
|
|
||||||
|
|
@ -11,8 +11,8 @@
|
||||||
- set_fact:
|
- set_fact:
|
||||||
has_java_keytool: >-
|
has_java_keytool: >-
|
||||||
{{
|
{{
|
||||||
ansible_os_family not in ['Darwin', 'FreeBSD']
|
ansible_facts.os_family not in ['Darwin', 'FreeBSD']
|
||||||
and not (ansible_distribution == "CentOS" and ansible_distribution_version is version("7.0", "<"))
|
and not (ansible_facts.distribution == "CentOS" and ansible_facts.distribution_version is version("7.0", "<"))
|
||||||
}}
|
}}
|
||||||
|
|
||||||
- name: Include OS-specific variables
|
- name: Include OS-specific variables
|
||||||
|
|
@ -20,10 +20,10 @@
|
||||||
vars:
|
vars:
|
||||||
params:
|
params:
|
||||||
files:
|
files:
|
||||||
- '{{ ansible_distribution }}-{{ ansible_distribution_version }}.yml'
|
- '{{ ansible_facts.distribution }}-{{ ansible_facts.distribution_version }}.yml'
|
||||||
- '{{ ansible_distribution }}-{{ ansible_distribution_major_version }}.yml'
|
- '{{ ansible_facts.distribution }}-{{ ansible_facts.distribution_major_version }}.yml'
|
||||||
- '{{ ansible_distribution }}.yml'
|
- '{{ ansible_facts.distribution }}.yml'
|
||||||
- '{{ ansible_os_family }}.yml'
|
- '{{ ansible_facts.os_family }}.yml'
|
||||||
paths:
|
paths:
|
||||||
- '{{ role_path }}/vars'
|
- '{{ role_path }}/vars'
|
||||||
when: has_java_keytool
|
when: has_java_keytool
|
||||||
|
|
|
||||||
|
|
@ -9,4 +9,4 @@
|
||||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
|
||||||
- include_tasks: ubuntu.yml
|
- include_tasks: ubuntu.yml
|
||||||
when: ansible_distribution == 'Ubuntu'
|
when: ansible_facts.distribution == 'Ubuntu'
|
||||||
|
|
|
||||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue