-
Notifications
You must be signed in to change notification settings - Fork 70
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into multiple-certs
- Loading branch information
Showing
39 changed files
with
509 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
========================== | ||
Playbook - tripleo_cleanup | ||
========================== | ||
|
||
Stops and disables all tripleo services running on target hosts. | ||
Heuristic based on systemd unit name pattern matching is used to determine | ||
which services should be stopped and disabled. | ||
|
||
.. literalinclude:: ../../../playbooks/tripleo_cleanup.yml | ||
:language: YAML |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
================================ | ||
Role - edpm_tripleo_cleanup | ||
================================ | ||
|
||
Role stops and disables all systemd units enumerated to it. | ||
If the role doesn't recieve list of services, it will instead stop and disable | ||
all units containing string "tripleo" in their name. | ||
|
||
This way we can effectivelly prevent any leftovers of original tripleo based | ||
deployment from interfering with post-adoption setup. | ||
|
||
.. include:: | ||
../collections/osp/edpm/edpm_tripleo_cleanup_role.rst |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
--- | ||
# Copyright 2024 Red Hat, Inc. | ||
# All Rights Reserved. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); you may | ||
# not use this file except in compliance with the License. You may obtain | ||
# a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | ||
# License for the specific language governing permissions and limitations | ||
# under the License. | ||
|
||
|
||
- name: Cleanup Tripleo services | ||
hosts: "{{ edpm_override_hosts | default('all', true) }}" | ||
strategy: linear | ||
gather_facts: true | ||
any_errors_fatal: "{{ edpm_any_errors_fatal | default(true) }}" | ||
max_fail_percentage: "{{ edpm_max_fail_percentage | default(0) }}" | ||
tasks: | ||
- name: Stop and disable Tripleo services | ||
ansible.builtin.import_role: | ||
name: osp.edpm.edpm_tripleo_cleanup |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
19 changes: 19 additions & 0 deletions
19
...m_pre_adoption_validation/molecule/hostname-service-config-hostname-mismatch/converge.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
--- | ||
- name: Converge | ||
hosts: all | ||
tasks: | ||
- name: Converge | ||
block: | ||
- name: "Include role" | ||
ansible.builtin.include_role: | ||
name: osp.edpm.edpm_pre_adoption_validation | ||
|
||
- name: "Check execution halted" | ||
ansible.builtin.fail: | ||
msg: "Execution should stop before this task" | ||
register: should_not_run | ||
rescue: | ||
- name: Asset that role failed | ||
ansible.builtin.assert: | ||
that: | ||
- should_not_run is not defined |
33 changes: 33 additions & 0 deletions
33
...m_pre_adoption_validation/molecule/hostname-service-config-hostname-mismatch/molecule.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
--- | ||
dependency: | ||
name: galaxy | ||
driver: | ||
name: podman | ||
platforms: | ||
- name: edpm-0 | ||
command: /sbin/init | ||
dockerfile: ../../../../molecule/common/Containerfile.j2 | ||
image: ${EDPM_ANSIBLE_MOLECULE_IMAGE:-"ubi9/ubi-init"} | ||
registry: | ||
url: ${EDPM_ANSIBLE_MOLECULE_REGISTRY:-"registry.access.redhat.com"} | ||
ulimits: | ||
- host | ||
provisioner: | ||
name: ansible | ||
inventory: | ||
hosts: | ||
all: | ||
vars: | ||
edpm_pre_adoption_validation_tuned_enabled: false | ||
hosts: | ||
edpm-0: | ||
canonical_hostname: edpm-0.localdomain | ||
|
||
verifier: | ||
name: ansible | ||
scenario: | ||
test_sequence: | ||
- destroy | ||
- create | ||
- prepare | ||
- converge |
52 changes: 52 additions & 0 deletions
52
...pm_pre_adoption_validation/molecule/hostname-service-config-hostname-mismatch/prepare.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
--- | ||
# Copyright 2023 Red Hat, Inc. | ||
# All Rights Reserved. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); you may | ||
# not use this file except in compliance with the License. You may obtain | ||
# a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | ||
# License for the specific language governing permissions and limitations | ||
# under the License. | ||
|
||
|
||
- name: Prepare | ||
hosts: all | ||
roles: | ||
- role: ../../../../molecule/common/test_deps # noqa: role-name[path] | ||
- role: osp.edpm.env_data | ||
- name: Setup DUT | ||
hosts: all | ||
pre_tasks: | ||
- name: Install hostname | ||
become: true | ||
ansible.builtin.dnf: | ||
name: "hostname" | ||
state: present | ||
|
||
- name: Ensure old config directory exists | ||
ansible.builtin.file: | ||
path: "{{ item.path }}" | ||
state: "directory" | ||
mode: "0777" | ||
loop: | ||
- {"path": "/var/lib/config-data/puppet-generated/nova_libvirt/etc/nova/"} | ||
- {"path": "/var/lib/config-data/puppet-generated/neutron/etc/neutron/"} | ||
|
||
- name: Copy old configs to simulate a tripleo deployment | ||
become: true | ||
vars: | ||
test_data: "{{ lookup('env', 'MOLECULE_SCENARIO_DIRECTORY') }}/test-data" | ||
ansible.builtin.copy: | ||
src: "{{ item.src }}" | ||
dest: "{{ item.dest }}" | ||
mode: preserve | ||
loop: | ||
- {"src": "{{ test_data }}/old_nova.conf", "dest": "/var/lib/config-data/puppet-generated/nova_libvirt/etc/nova/nova.conf"} | ||
- {"src": "{{ test_data }}/old_neutron.conf", "dest": "/var/lib/config-data/puppet-generated/neutron/etc/neutron/neutron.conf"} | ||
tasks: [] |
2 changes: 2 additions & 0 deletions
2
..._validation/molecule/hostname-service-config-hostname-mismatch/test-data/old_neutron.conf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[DEFAULT] | ||
host=edpm-0.localdomain |
2 changes: 2 additions & 0 deletions
2
...ion_validation/molecule/hostname-service-config-hostname-mismatch/test-data/old_nova.conf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[DEFAULT] | ||
host = edpm-0.localdomain |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.