Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/docs-requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# this is required for the docs build jobs
ansible-core>=2.15.0,<2.19.0
ansible-core>=2.15.0
sphinx>=2.0.0,!=2.1.0 # BSD
reno>=3.1.0 # Apache-2.0
doc8>=0.8.1 # Apache-2.0
Expand Down
2 changes: 1 addition & 1 deletion molecule-requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ansible-core>=2.15.0,<2.19.0
ansible-core>=2.15.0
molecule>=5.1.0,<6.0.0
molecule-plugins[podman,vagrant]>=23.5.0
pytest-testinfra
Expand Down
2 changes: 1 addition & 1 deletion openstack_ansibleee/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ansible-core>=2.16.1,<2.19.0
ansible-core>=2.16.1
ansible-runner>=2.4.0
ansible-builder>=3.1.0
dumb-init>=1.2.2
10 changes: 7 additions & 3 deletions plugins/action/container_systemd.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@

from ansible.errors import AnsibleActionFail
from ansible.plugins.action import ActionBase
try:
from ansible.template import trust_as_template
except ImportError:
def trust_as_template(data):
return data
from ansible.utils.display import Display


Expand Down Expand Up @@ -200,11 +205,10 @@ def _get_unit_template(self):
'systemd-service.j2'
)
if not os.path.exists(source):
raise AnsibleActionFail('Template {} was '
'not found'.format(source))
raise AnsibleActionFail('Template {} was not found'.format(source))
with open(source) as template_file:
data = template_file.read()
return data
return trust_as_template(data)

def _create_units(self, container_config, task_vars):
"""Create system units and get list of changed services
Expand Down
2 changes: 1 addition & 1 deletion roles/edpm_kernel/tasks/hugepages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
_converted_hugepages: {}
_nonconfig_hugepages: {}
_hugepages_modification: false
when: edpm_kernel_hugepages | length
when: edpm_kernel_hugepages | default({}) | length > 0

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK this is the actual change to the huge page

the other 3 commits in this pr are unrealted to the subject of the PR.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All commits are related to the jira linked. I'll update the PR when everything is fixed for the jira.

block:
- name: Rewrite edpm_kernel_hugepages to use integers as keys
ansible.builtin.set_fact:
Expand Down
2 changes: 1 addition & 1 deletion roles/edpm_libvirt/tasks/virsh-secret.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,4 @@
KEY: "{{ cephx_key.stdout | regex_replace('\"', '') }}"
when:
- cephx_key.stdout is defined
- cephx_key.stdout | regex_replace('\"', '') | regex_search('^[a-zA-Z0-9+/]{38}==$')
- cephx_key.stdout | regex_replace('\"', '') | regex_search('^[a-zA-Z0-9+/]{38}==$') | length > 0
14 changes: 7 additions & 7 deletions roles/edpm_nftables/templates/dport.j2
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
{%- set ns = namespace(_dport='') %}
{%- set ns = namespace(dport='') %}
{%- if 'dport' in rule %}
{% if rule['dport'] is iterable and (rule['dport'] is not string and rule['dport'] is not mapping) -%}
{% set ns._dport = rule['dport'] |join(', ') -%}
{% set ns.dport = rule['dport'] |join(', ') -%}
{% else -%}
{% set ns._dport = rule['dport'] -%}
{% set ns.dport = rule['dport'] -%}
{% endif -%}
{%- endif %}
{#- This is for legacy things - Really, use dport... #}
{%- if 'port' in rule %}
{% if rule['port'] is iterable and (rule['port'] is not string and rule['port'] is not mapping) -%}
{% set ns._dport = rule['port'] |join(', ') -%}
{% set ns.dport = rule['port'] |join(', ') -%}
{% else -%}
{% set ns._dport = rule['port'] -%}
{% set ns.dport = rule['port'] -%}
{% endif -%}
{%- endif %}
{%- if ns._dport != '' %}
{{ rule.get('proto', false)|ternary('', 'tcp ') }}dport { {{ ns._dport |replace(':', '-') }} }
{%- if ns.dport != '' %}
{{ rule.get('proto', false)|ternary('', 'tcp ') }}dport { {{ ns.dport |replace(':', '-') }} }
{%- endif %}
23 changes: 15 additions & 8 deletions roles/edpm_ovn/tasks/cleanup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,44 +31,51 @@
changed_when: false
ignore_errors: true

- name: Initialize cleanup_ovn_cms_options_stdout variable
ansible.builtin.set_fact:
cleanup_ovn_cms_options_stdout: "{{ cleanup_ovn_cms_options.stdout | default('') }}"
when: cleanup_ovn_cms_options.rc == 0

- name: Cleanup enable-chassis-as-gw when chassis GW not enabled
ansible.builtin.set_fact:
cleanup_ovn_cms_options: "{{ cleanup_ovn_cms_options | regex_replace('enable-chassis-as-gw' ~ ',?', '') }}"
cleanup_ovn_cms_options_stdout: "{{ cleanup_ovn_cms_options_stdout | regex_replace('enable-chassis-as-gw' ~ ',?', '') }}"
when:
- not edpm_enable_chassis_gw | bool
- cleanup_ovn_cms_options.rc == 0
- cleanup_ovn_cms_options_stdout | length > 0

- name: Cleanup enable-chassis-as-extport-host when chassis extport not enabled
ansible.builtin.set_fact:
cleanup_ovn_cms_options: "{{ cleanup_ovn_cms_options | regex_replace('enable-chassis-as-extport-host' ~ ',?', '') }}"
cleanup_ovn_cms_options_stdout: "{{ cleanup_ovn_cms_options_stdout | regex_replace('enable-chassis-as-extport-host' ~ ',?', '') }}"
when:
- not edpm_enable_chassis_extport | bool
- cleanup_ovn_cms_options.rc == 0
- cleanup_ovn_cms_options_stdout | length > 0

- name: Cleanup availability-zones
when:
- edpm_ovn_availability_zones | length == 0
- cleanup_ovn_cms_options.rc == 0
- cleanup_ovn_cms_options_stdout | length > 0
block:
- name: Filter out availability-zones from stdout when undefined
ansible.builtin.set_fact:
filtered_azs:
stdout: "{{ cleanup_ovn_cms_options.stdout | regex_replace('availability-zones=[^,]*' ~ ',?', '') }}"
filtered_azs: "{{ cleanup_ovn_cms_options_stdout | regex_replace('availability-zones=[^,]*' ~ ',?', '') }}"

- name: Update cleanup_ovn_cms_options with filtered azs
ansible.builtin.set_fact:
cleanup_ovn_cms_options: "{{ cleanup_ovn_cms_options | combine(filtered_azs | default({})) }}"
cleanup_ovn_cms_options_stdout: "{{ filtered_azs }}"

- name: Set updated OVN CMS Options to the local OVSDB
become: true
ansible.builtin.shell: >
ovs-vsctl set Open_vSwitch . external_ids:ovn-cms-options={{ cleanup_ovn_cms_options.stdout }}
ovs-vsctl set Open_vSwitch . external_ids:ovn-cms-options={{ cleanup_ovn_cms_options_stdout }}
register: cleanup_ovn_cms_options_set
changed_when: cleanup_ovn_cms_options_set.rc == 0
failed_when: cleanup_ovn_cms_options_set.rc != 0
when:
- cleanup_ovn_cms_options.rc == 0
- cleanup_ovn_cms_options.stdout != ""
- cleanup_ovn_cms_options_stdout | length > 0

- name: Clear OVN CMS Options if updated string is empty
become: true
Expand All @@ -79,4 +86,4 @@
failed_when: cleanup_ovn_cms_options_remove.rc != 0
when:
- cleanup_ovn_cms_options.rc == 0
- cleanup_ovn_cms_options.stdout == ""
- cleanup_ovn_cms_options_stdout | length == 0
24 changes: 12 additions & 12 deletions roles/edpm_ovs_dpdk/tasks/configure.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@
- name: Check valid input for edpm_ovs_dpdk_pmd_core_list
ansible.builtin.fail:
msg: "List of PMD cores cannot be empty - edpm_ovs_dpdk_pmd_core_list"
when: not edpm_ovs_dpdk_pmd_core_list|string or edpm_ovs_dpdk_pmd_core_list == 'null'
when: edpm_ovs_dpdk_pmd_core_list|string|length == 0 or edpm_ovs_dpdk_pmd_core_list == 'null'

- name: PMD cores config
when: edpm_ovs_dpdk_pmd_core_list|string
when: edpm_ovs_dpdk_pmd_core_list|string|length > 0
block:
- name: Apply PMD cores config
ansible.builtin.set_fact:
Expand All @@ -47,7 +47,7 @@
edpm_ovs_other_config: "{{ edpm_ovs_other_config | combine(dpdk_extra) }}"

- name: Set socket-mem and socket-limit config
when: edpm_ovs_dpdk_socket_memory|string
when: edpm_ovs_dpdk_socket_memory|string|length > 0
block:
- name: Apply socket-mem config
ansible.builtin.set_fact:
Expand All @@ -64,7 +64,7 @@
edpm_ovs_other_config: "{{ edpm_ovs_other_config | combine(dpdk_socket_mem) | combine(dpdk_socket_limit) }}"

- name: Set Revalidator threads config
when: edpm_ovs_dpdk_revalidator_cores|string
when: edpm_ovs_dpdk_revalidator_cores|string|length > 0
block:
- name: Apply Revalidator threads config
ansible.builtin.set_fact:
Expand All @@ -76,7 +76,7 @@
edpm_ovs_other_config: "{{ edpm_ovs_other_config | combine(n_revalidator_threads) }}"

- name: Set Handler threads config
when: edpm_ovs_dpdk_handler_cores|string
when: edpm_ovs_dpdk_handler_cores|string|length > 0
block:
- name: Apply Handler threads config
ansible.builtin.set_fact:
Expand All @@ -88,7 +88,7 @@
edpm_ovs_other_config: "{{ edpm_ovs_other_config | combine(n_handler_threads) }}"

- name: Set EMC Insertion Probability config
when: edpm_ovs_dpdk_emc_insertion_probablity|string
when: edpm_ovs_dpdk_emc_insertion_probablity|string|length > 0
block:
- name: Apply EMC Insertion Probability config
ansible.builtin.set_fact:
Expand Down Expand Up @@ -149,7 +149,7 @@
edpm_ovs_other_config: "{{ edpm_ovs_other_config | combine(pmd_auto_lb) }}"

- name: Set minimum PMD thread load threshold
when: edpm_ovs_dpdk_pmd_load_threshold|string
when: edpm_ovs_dpdk_pmd_load_threshold|string|length > 0
block:
- name: Apply minimum PMD thread load threshold
ansible.builtin.set_fact:
Expand All @@ -161,7 +161,7 @@
edpm_ovs_other_config: "{{ edpm_ovs_other_config | combine(pmd_auto_lb_load_threshold) }}"

- name: Set PMD load variance improvement threshold
when: edpm_ovs_dpdk_pmd_improvement_threshold|string
when: edpm_ovs_dpdk_pmd_improvement_threshold|string|length > 0
block:
- name: Apply PMD load variance improvement threshold
ansible.builtin.set_fact:
Expand All @@ -173,7 +173,7 @@
edpm_ovs_other_config: "{{ edpm_ovs_other_config | combine(pmd_auto_lb_improvement_threshold) }}"

- name: Set PMD auto load balancing interval
when: edpm_ovs_dpdk_pmd_rebal_interval|string
when: edpm_ovs_dpdk_pmd_rebal_interval|string|length > 0
block:
- name: Apply PMD auto load balancing interval
ansible.builtin.set_fact:
Expand All @@ -185,7 +185,7 @@
edpm_ovs_other_config: "{{ edpm_ovs_other_config | combine(pmd_auto_lb_rebal_interval) }}"

- name: OVN bridge datapath type config
when: edpm_ovn_datapath_type|string
when: edpm_ovn_datapath_type|string|length > 0
block:
- name: Apply PMD cores config
ansible.builtin.set_fact:
Expand All @@ -197,7 +197,7 @@
edpm_ovs_external_ids: "{{ {} | combine(ovn_bridge_datapath_type) }}"

- name: Set shared memory pool config
when: edpm_ovs_dpdk_shared_mem_pool|string
when: edpm_ovs_dpdk_shared_mem_pool|string|length > 0
block:
- name: Apply shared memory pool config
ansible.builtin.set_fact:
Expand All @@ -209,7 +209,7 @@
edpm_ovs_other_config: "{{ edpm_ovs_other_config | combine(dpdk_shared_mem_pool) }}"

- name: Set PMD maximum sleep time
when: edpm_ovs_dpdk_pmd_sleep_max|string
when: edpm_ovs_dpdk_pmd_sleep_max|string|length > 0
block:
- name: Apply PMD maximum sleep time
ansible.builtin.set_fact:
Expand Down
2 changes: 1 addition & 1 deletion roles/edpm_pre_adoption_validation/tasks/kernel_args.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,4 @@
# In the other hand neither the edpm_kernel role during deployment and
# adoption nor this adoption check enforces to list the existing kernel args
# in edpm_kernel_args ansible variable.
failed_when: not (cmdline | regex_search( '^.*' + edpm_kernel_args | default('') + '.*$' | string ))
failed_when: not (cmdline | regex_search( '^.*' + edpm_kernel_args | default('') + '.*$' | string))
6 changes: 3 additions & 3 deletions roles/edpm_ssh_known_hosts/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@

- name: Gather facts if they don't exist
when:
- ("'ssh_host_key_rsa_public' not in ansible_facts") or
("'ssh_host_key_ed25519_public' not in ansible_facts") or
("'ssh_host_key_ecdsa_public' not in ansible_facts")
- ('ssh_host_key_rsa_public' not in ansible_facts) or
('ssh_host_key_ed25519_public' not in ansible_facts) or
('ssh_host_key_ecdsa_public' not in ansible_facts)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this fixing a separate bug?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, this is broken conditional in 2.19.

Conditional result was "'ssh_host_key_rsa_public' not in [...]" of type 'str', which evaluates to True. Conditionals must have a boolean result.

Broken conditionals can be temporarily allowed with the ALLOW_BROKEN_CONDITIONALS configuration option.

ansible.builtin.setup:
gather_subset:
- "!all"
Expand Down