|
| 1 | +--- |
| 2 | +# Copyright 2025 Red Hat, Inc. |
| 3 | +# All Rights Reserved. |
| 4 | +# |
| 5 | +# Licensed under the Apache License, Version 2.0 (the "License"); you may |
| 6 | +# not use this file except in compliance with the License. You may obtain |
| 7 | +# a copy of the License at |
| 8 | +# |
| 9 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | +# |
| 11 | +# Unless required by applicable law or agreed to in writing, software |
| 12 | +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
| 13 | +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the |
| 14 | +# License for the specific language governing permissions and limitations |
| 15 | +# under the License. |
| 16 | + |
| 17 | + |
| 18 | +- name: Run the default verify playbook |
| 19 | + import_playbook: ../default/verify.yml |
| 20 | + |
| 21 | +- name: Verify the adoption scenario |
| 22 | + hosts: all |
| 23 | + gather_facts: false |
| 24 | + become: true |
| 25 | + vars: |
| 26 | + test_helper_dir: "../../../../molecule/test-helpers" |
| 27 | + tasks: |
| 28 | + - name: Load role vars |
| 29 | + ansible.builtin.include_vars: ../../defaults/main.yml |
| 30 | + |
| 31 | + - name: Verify the containerized iscsid config dir was renamed |
| 32 | + ansible.builtin.include_tasks: "{{test_helper_dir}}/verify_dir.yaml" |
| 33 | + vars: |
| 34 | + item: "{{ edpm_iscsid_tripleo_config_dir }}.adopted" |
| 35 | + |
| 36 | + - name: Verify the containerized iscsid.conf file was adopted |
| 37 | + become: true |
| 38 | + ansible.builtin.command: | |
| 39 | + grep -q '^node.session.foo = bar$' /etc/iscsi/iscsid.conf |
| 40 | + changed_when: false |
| 41 | + |
| 42 | + - name: Verify the IQN file was adopted |
| 43 | + ansible.builtin.command: | |
| 44 | + grep -q '^InitiatorName=iqn.1994-05.com.redhat:abcdef012345$' /etc/iscsi/initiatorname.iscsi |
| 45 | + changed_when: false |
| 46 | + |
| 47 | + - name: Check the status of IQN reset sentinel file |
| 48 | + ansible.builtin.stat: |
| 49 | + path: /etc/iscsi/.initiator_reset |
| 50 | + register: sentinel_exists |
| 51 | + |
| 52 | + - name: Assert the IQN reset sentinel file exists |
| 53 | + ansible.builtin.assert: |
| 54 | + that: |
| 55 | + - sentinel_exists.stat.exists |
| 56 | + fail_msg: "The IQN reset sentinel file does not exist" |
0 commit comments