diff --git a/infra/azure/pr-pipeline.yml b/infra/azure/pr-pipeline.yml index 9d990dfd..8eff18e3 100644 --- a/infra/azure/pr-pipeline.yml +++ b/infra/azure/pr-pipeline.yml @@ -13,7 +13,9 @@ parameters: type: object default: - { distro: "c8s", ansible_version: "2.16" } - - { distro: "c9s", ansible_version: "2.14" } + # c9s should use 2.14, but this version has an invalid certificate + # and so is unsuable against ansible-galaxy. + - { distro: "c9s", ansible_version: "2.16" } - { distro: "c10s", ansible_version: "2.16" } variables: diff --git a/plugins/inventory/freeipa.py b/plugins/inventory/freeipa.py index 8cb2ec5b..fc1c0ef0 100644 --- a/plugins/inventory/freeipa.py +++ b/plugins/inventory/freeipa.py @@ -107,7 +107,7 @@ from ansible.plugins.inventory import BaseInventoryPlugin from ansible.module_utils.six.moves.urllib.parse import quote -class InventoryModule(BaseInventoryPlugin): +class InventoryModule(BaseInventoryPlugin): # pylint: disable=R0901 NAME = 'freeipa' diff --git a/pytest.ini b/pytest.ini index d9707737..f325221a 100644 --- a/pytest.ini +++ b/pytest.ini @@ -4,3 +4,4 @@ junit_family = xunit1 markers= source_order: mark test as order bound playbook: playbook tests +pythonpath = tests diff --git a/requirements-tests.txt b/requirements-tests.txt index e6f74d64..052ba720 100644 --- a/requirements-tests.txt +++ b/requirements-tests.txt @@ -1,8 +1,8 @@ -r requirements.txt -pytest==7.1.3 -pytest-sourceorder==0.6.0 +pytest +pytest-sourceorder pytest-split>=0.8.0 pytest-custom_exit_code>=0.3.0 -pytest-testinfra==6.8.0 -pytest-randomly==3.12.0 +pytest-testinfra +pytest-randomly pyyaml>=3 diff --git a/requirements.txt b/requirements.txt index e69de29b..49fe098d 100644 --- a/requirements.txt +++ b/requirements.txt @@ -0,0 +1 @@ +setuptools diff --git a/roles/ipaclient/tasks/install.yml b/roles/ipaclient/tasks/install.yml index ca56be3d..7191cece 100644 --- a/roles/ipaclient/tasks/install.yml +++ b/roles/ipaclient/tasks/install.yml @@ -181,10 +181,10 @@ - name: Install - Store the previously obtained OTP no_log: yes + when: result_ipaclient_get_otp.host is defined ansible.builtin.set_fact: ipaadmin_orig_password: "{{ ipaadmin_password | default(omit) }}" - ipaadmin_password: "{{ result_ipaclient_get_otp.host.randompassword - if result_ipaclient_get_otp.host is defined }}" + ipaadmin_password: "{{ result_ipaclient_get_otp.host.randompassword | default(omit) }}" rescue: - name: Install - Report error for OTP generation ansible.builtin.debug: diff --git a/setup.cfg b/setup.cfg index c1cd4c64..b0cbe64d 100644 --- a/setup.cfg +++ b/setup.cfg @@ -61,7 +61,12 @@ good-names = dt, ca, # These are utils tools, and not part of the released collection. galaxyfy-playbook, galaxyfy-README, galaxyfy-module-EXAMPLES, - module_EXAMPLES + module_EXAMPLES, + MODULE_IMPORT_ERROR, ANSIBLE_IPA_CLIENT_MODULE_IMPORT_ERROR, + CLIENT_SUPPORTS_NO_DNSSEC_VALIDATION, ANSIBLE_IPA_REPLICA_MODULE_IMPORT_ERROR, + SYSTEMD_RESOLVED_IPA_CONF, ANSIBLE_IPA_SERVER_MODULE_IMPORT_ERROR, + NETWORK_MANAGER_IPA_CONF, ANSIBLE_FREEIPA_MODULE_IMPORT_ERROR, + FIX_6741_DEEPCOPY_OBJECTCLASSES [pylint.IMPORTS] diff --git a/tests/config/test_config.yml b/tests/config/test_config.yml index 555a142e..525e4b33 100644 --- a/tests/config/test_config.yml +++ b/tests/config/test_config.yml @@ -400,7 +400,7 @@ searchrecordslimit: '{{ previousconfig.config.searchrecordslimit | default(100) | int }}' usersearch: '{{ previousconfig.config.usersearch | default(omit) }}' groupsearch: '{{ previousconfig.config.groupsearch | default(omit) }}' - enable_migration: '{{ previousconfig.config.enable_migration | default(False) | bool }}' + enable_migration: '{{ omit if previousconfig.config.enable_migration is not defined else (previousconfig.config.enable_migration | bool) }}' groupobjectclasses: '{{ previousconfig.config.groupobjectclasses | default(omit) }}' userobjectclasses: '{{ previousconfig.config.userobjectclasses | default(omit) }}' pwdexpnotify: '{{ previousconfig.config.pwdexpnotify | default(4) | int }}' @@ -436,7 +436,7 @@ searchrecordslimit: '{{ previousconfig.config.searchrecordslimit | default(omit) | int }}' usersearch: '{{ previousconfig.config.usersearch | default(omit) }}' groupsearch: '{{ previousconfig.config.groupsearch | default(omit) }}' - enable_migration: '{{ previousconfig.config.enable_migration | default(omit) | bool }}' + enable_migration: '{{ omit if previousconfig.config.enable_migration is not defined else (previousconfig.config.enable_migration | bool) }}' groupobjectclasses: '{{ previousconfig.config.groupobjectclasses | default(omit) }}' userobjectclasses: '{{ previousconfig.config.userobjectclasses | default(omit) }}' pwdexpnotify: '{{ previousconfig.config.pwdexpnotify | default(omit) | int }}' @@ -473,7 +473,7 @@ searchrecordslimit: '{{ previousconfig.config.searchrecordslimit | default(omit) | int }}' usersearch: '{{ previousconfig.config.usersearch | default(omit) }}' groupsearch: '{{ previousconfig.config.groupsearch | default(omit) }}' - enable_migration: '{{ previousconfig.config.enable_migration | default(omit) | bool }}' + enable_migration: '{{ omit if previousconfig.config.enable_migration is not defined else (previousconfig.config.enable_migration | bool) }}' groupobjectclasses: '{{ previousconfig.config.groupobjectclasses | default(omit) }}' userobjectclasses: '{{ previousconfig.config.userobjectclasses | default(omit) }}' pwdexpnotify: '{{ previousconfig.config.pwdexpnotify | default(omit) | int }}'