diff --git a/.automation/build.sh b/.automation/build.sh index cfd3faa4..dbea2620 100755 --- a/.automation/build.sh +++ b/.automation/build.sh @@ -67,7 +67,8 @@ cp -r "$OVIRT_BUILD"/* "$OVIRT_BUILD"/.config "$COLLECTION_DIR" cd "$COLLECTION_DIR" antsibull-changelog lint -v -ansible-lint roles/* +#skip linting, done in separate github workflow +#ansible-lint roles/* cd "$ROOT_PATH" diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 93a0833f..1ccedfc0 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -19,6 +19,9 @@ jobs: sudo add-apt-repository ppa:deadsnakes/ppa sudo apt-get install python3.9-venv -y + - name: Install ansible.posix + run: ansible-galaxy collection install -c ansible.posix + - name: Checkout uses: ovirt/checkout-action@main @@ -49,7 +52,7 @@ jobs: "ansible-lint>=6.0.0,<7.0.0" \ cryptography \ "pyyaml>=5.4.1" - ansible-lint roles/* -x 204 + ansible-lint -x 'key-order[task],no-free-form,schema[vars],yaml[octal-values],risky-shell-pipe,fqcn[keyword]' roles/* build: runs-on: ubuntu-latest strategy: @@ -69,6 +72,9 @@ jobs: - name: Install python3.9 modules run: ${{ matrix.pip-command }} install pycodestyle pylint voluptuous yamllint rstcheck antsibull-changelog rich "ansible-lint>=6.0.0,<7.0.0" cryptography + - name: Install ansible.posix + run: ansible-galaxy collection install -c ansible.posix + - name: Checkout uses: ovirt/checkout-action@main diff --git a/changelogs/fragments/700-fix-directlun.yml b/changelogs/fragments/700-fix-directlun.yml new file mode 100644 index 00000000..94d7b60b --- /dev/null +++ b/changelogs/fragments/700-fix-directlun.yml @@ -0,0 +1,3 @@ +--- +bugfixes: + - ovirt_disk - Fix issue in detaching the direct LUN (https://github.com/oVirt/ovirt-ansible-collection/pull/700) diff --git a/changelogs/fragments/702-drop-netaddr2.yml b/changelogs/fragments/702-drop-netaddr2.yml new file mode 100644 index 00000000..11a08512 --- /dev/null +++ b/changelogs/fragments/702-drop-netaddr2.yml @@ -0,0 +1,3 @@ +--- +bugfixes: + - HE - drop remaining filters using netaddr (https://github.com/oVirt/ovirt-ansible-collection/pull/702) diff --git a/changelogs/fragments/704-drop-netaddr3.yml b/changelogs/fragments/704-drop-netaddr3.yml new file mode 100644 index 00000000..c9fc979a --- /dev/null +++ b/changelogs/fragments/704-drop-netaddr3.yml @@ -0,0 +1,3 @@ +--- +bugfixes: + - HE - fix ipv4 and ipv6 check after dropping netaddr (https://github.com/oVirt/ovirt-ansible-collection/pull/704) diff --git a/changelogs/fragments/706-he-update-README.yml b/changelogs/fragments/706-he-update-README.yml new file mode 100644 index 00000000..d2b8793e --- /dev/null +++ b/changelogs/fragments/706-he-update-README.yml @@ -0,0 +1,3 @@ +--- +bugfixes: + - hosted_engine_setup - Update README (https://github.com/oVirt/ovirt-ansible-collection/pull/706) diff --git a/plugins/modules/ovirt_disk.py b/plugins/modules/ovirt_disk.py index 019ab32d..de82631c 100644 --- a/plugins/modules/ovirt_disk.py +++ b/plugins/modules/ovirt_disk.py @@ -731,7 +731,7 @@ def update_check(self, entity): equal(self.param('propagate_errors'), entity.propagate_errors) and equal(otypes.ScsiGenericIO(self.param('scsi_passthrough')) if self.param('scsi_passthrough') else None, entity.sgio) and equal(self.param('wipe_after_delete'), entity.wipe_after_delete) and - equal(self.param('profile'), follow_link(self._connection, entity.disk_profile).name) + equal(self.param('profile'), getattr(follow_link(self._connection, entity.disk_profile), 'name', None)) ) diff --git a/roles/hosted_engine_setup/README.md b/roles/hosted_engine_setup/README.md index 706fb87f..5f6007f8 100644 --- a/roles/hosted_engine_setup/README.md +++ b/roles/hosted_engine_setup/README.md @@ -318,7 +318,7 @@ $ ansible-playbook hosted_engine_deploy.yml --extra-vars='@he_deployment.json' - Deployment over a remote host: ```sh -ansible-playbook -i host123.localdomain, hosted_engine_deploy.yml --extra-vars='@he_deployment.json' --extra-vars='@passwords.yml' --ask-vault-pass +$ ansible-playbook -i host123.localdomain, hosted_engine_deploy.yml --extra-vars='@he_deployment.json' --extra-vars='@passwords.yml' --ask-vault-pass ``` Deploy over a remote host from Ansible AWX/Tower diff --git a/roles/hosted_engine_setup/hooks/after_setup/add_host_storage_domain.yml b/roles/hosted_engine_setup/hooks/after_setup/add_host_storage_domain.yml index ad7df40e..59e9cabf 100644 --- a/roles/hosted_engine_setup/hooks/after_setup/add_host_storage_domain.yml +++ b/roles/hosted_engine_setup/hooks/after_setup/add_host_storage_domain.yml @@ -8,7 +8,7 @@ - name: Set Engine public key as authorized key without validating the TLS/SSL certificates connection: ssh - authorized_key: + ansible.posix.authorized_key: user: root state: present key: https://{{ he_fqdn }}/ovirt-engine/services/pki-resource?resource=engine-certificate&format=OPENSSH-PUBKEY diff --git a/roles/hosted_engine_setup/tasks/bootstrap_local_vm/05_add_host.yml b/roles/hosted_engine_setup/tasks/bootstrap_local_vm/05_add_host.yml index 921a8aea..67a3038f 100644 --- a/roles/hosted_engine_setup/tasks/bootstrap_local_vm/05_add_host.yml +++ b/roles/hosted_engine_setup/tasks/bootstrap_local_vm/05_add_host.yml @@ -34,7 +34,7 @@ register: vlan_id_out changed_when: true - name: Set Engine public key as authorized key without validating the TLS/SSL certificates - authorized_key: + ansible.posix.authorized_key: user: root state: present key: https://{{ he_fqdn }}/ovirt-engine/services/pki-resource?resource=engine-certificate&format=OPENSSH-PUBKEY diff --git a/roles/hosted_engine_setup/tasks/create_target_vm/03_hosted_engine_final_tasks.yml b/roles/hosted_engine_setup/tasks/create_target_vm/03_hosted_engine_final_tasks.yml index b0321860..30cdce28 100644 --- a/roles/hosted_engine_setup/tasks/create_target_vm/03_hosted_engine_final_tasks.yml +++ b/roles/hosted_engine_setup/tasks/create_target_vm/03_hosted_engine_final_tasks.yml @@ -217,7 +217,7 @@ owner: root group: root mode: 0644 - when: he_vm_ip_addr is not none and he_vm_ip_addr | ipv4 + when: he_vm_ip_addr is not none and not he_vm_ip_addr is search(":") - name: Generate static network configuration for the engine VM, IPv6 ansible.builtin.template: src: templates/ifcfg-eth0-static-ipv6.j2 @@ -225,7 +225,7 @@ owner: root group: root mode: 0644 - when: he_vm_ip_addr is not none and he_vm_ip_addr | ipv6 + when: he_vm_ip_addr is not none and he_vm_ip_addr is search(":") - name: Inject network configuration with guestfish ansible.builtin.command: >- guestfish -a {{ local_vm_disk_path }} --rw -i copy-in "{{ he_local_vm_dir }}/ifcfg-eth0" diff --git a/roles/hosted_engine_setup/tasks/fetch_host_ip.yml b/roles/hosted_engine_setup/tasks/fetch_host_ip.yml index 4a066ab7..f1d149b9 100644 --- a/roles/hosted_engine_setup/tasks/fetch_host_ip.yml +++ b/roles/hosted_engine_setup/tasks/fetch_host_ip.yml @@ -33,7 +33,7 @@ ansible.builtin.set_fact: he_host_ip: "{{ ( - hostname_resolution_output.stdout.split() | + hostname_resolution_output.stdout.split() | intersect(hostname_addresses_output.stdout.split()) )[0] }}"