Drop tasks meant to run run_os_net_config.sh

The script has been dropped now. So we should drop these
permanently skipped tasks. Also adds check to not run the
async task in check mode.

Fixes the molecule tests and modifies bindep.txt to
install python3 packages on fedora to test locally.

Depends-On: https://review.opendev.org/#/c/751720/
Change-Id: I8a535b2df9716d083b2c28438d1006891c05da1c
This commit is contained in:
Rabi Mishra 2020-09-23 14:09:56 +05:30
parent 706cb2d5d8
commit b90d28996c
5 changed files with 42 additions and 87 deletions

View File

@ -19,9 +19,9 @@ git [platform:rpm]
libffi-devel [platform:rpm]
openssl-devel [platform:rpm]
podman [platform:rpm]
python-devel [platform:rpm !platform:rhel-8 !platform:centos-8]
python-devel [platform:rpm !platform:rhel-8 !platform:centos-8 !platform:fedora]
python3-devel [platform:rpm !platform:rhel-7 !platform:centos-7]
PyYAML [platform:rpm !platform:rhel-8 !platform:centos-8]
PyYAML [platform:rpm !platform:rhel-8 !platform:centos-8 !platform:fedora]
python3-pyyaml [platform:rpm !platform:rhel-7 !platform:centos-7]
python3-dnf [platform:rpm !platform:rhel-7 !platform:centos-7]

View File

@ -25,7 +25,6 @@ tripleo_network_config_bridge_name: br-ex
tripleo_network_config_debug: "{{ (ansible_verbosity | int) >= 2 | bool }}"
tripleo_network_config_hide_sensitive_logs: true
tripleo_network_config_interface_name: nic1
tripleo_network_config_legacy_script: true
tripleo_network_config_manage_service: true
tripleo_network_config_network_deployment_actions: []
tripleo_network_config_os_net_config_mappings: {}

View File

@ -17,43 +17,42 @@
- name: Converge
hosts: all
tasks:
- name: Success network script
block:
- name: Temp network script file
set_fact:
dummy_network_script: /var/tmp/dummy_network_script.sh
- name: Write out empty dummy network script
delegate_to: localhost
copy:
dest: "{{ dummy_network_script }}"
content: |
#/bin/bash
echo "stderr" >&2
exit 0
mode: '0755'
- import_role:
name: "tripleo_network_config"
vars:
tripleo_network_config_script_path: "{{ dummy_network_script }}"
# skip service management in a container
tripleo_network_config_manage_service: false
- name: Check returncode file
slurp:
path: /var/lib/tripleo-config/os-net-config.returncode
register: rc_file
- name: returncode file value is
debug:
msg: "{{ rc_file.content | b64decode }}"
- assert:
that:
- rc_file.content | b64decode | int == 0
always:
- name: Remove dummy script
become: true
file:
path: "{{ dummy_network_script }}"
state: absent
ignore_errors: true
vars:
tripleo_network_config_with_ansible: true
tripleo_network_config_template: templates/standalone.j2
tripleo_network_config_manage_service: false
tripleo_network_config_hide_sensitive_logs: false
local_mtu: 1500
ctlplane_ip: 192.168.24.1
ctlplane_subnet_cidr: 24
ctlplane_host_routes: []
ctlplane_dns_nameservers: []
dns_search_domains: []
neutron_public_interface_name: tap0
deployed_server_port_map:
control_virtual_ip:
fixed_ips:
- ip_address: 192.168.24.3
network:
tags:
- 192.168.24.0/24
subnets:
- cidr: 192.168.24.0/24
public_virtual_ip:
fixed_ips:
- ip_address: 192.168.24.1
network:
tags:
- 192.168.24.0/24
subnets:
- cidr: 192.168.24.0/24
standalone-ctlplane:
fixed_ips:
- ip_address: 192.168.24.1
network:
tags:
- 192.168.24.0/24
subnets:
- cidr: 192.168.24.0/24
roles:
- role: "tripleo_network_config"

View File

@ -58,37 +58,6 @@
dest: /etc/os-net-config/mapping.yaml
when: os_net_config_mappings_result.changed|bool
- name: Manage NetworkConfig with legacy run_os_net_config.sh
block:
- name: Create /var/lib/tripleo-config/scripts directory
file:
path: /var/lib/tripleo-config/scripts
state: directory
setype: container_file_t
selevel: s0
recurse: true
- name: Render NetworkConfig script
template:
dest: /var/lib/tripleo-config/scripts/run_os_net_config.sh
src: "{{ tripleo_network_config_script_path }}"
mode: 0755
when: not ansible_check_mode|bool
- name: Run NetworkConfig script
shell: /var/lib/tripleo-config/scripts/run_os_net_config.sh
async: "{{ tripleo_network_config_async_timeout }}"
poll: "{{ tripleo_network_config_async_poll }}"
environment:
bridge_name: "{{ tripleo_network_config_bridge_name }}"
interface_name: "{{ tripleo_network_config_interface_name }}"
register: NetworkConfig_result
when:
- not ansible_check_mode|bool
failed_when: NetworkConfig_result.rc is not defined
when:
- tripleo_network_config_legacy_script|bool
- name: Manage NetworkConfig with tripleo_os_net_config module
block:
- name: Remove /var/lib/tripleo-config/scripts directory
@ -98,8 +67,6 @@
- name: Run NetworkConfig with tripleo_os_net_config
include_tasks: os_net_config.yml
when:
- not tripleo_network_config_legacy_script|bool
- name: Write rc of NetworkConfig script
copy:
@ -108,17 +75,6 @@
when:
- NetworkConfig_result.rc is defined
# This task can be removed once we stop supporting the legacy script.
# tripleo_os_net_config module already prints out stdout/stderr and fails
# when there is a failure, we don't need an extra task for it.
- name: NetworkConfig stdout
debug:
var: NetworkConfig_result.stderr_lines
failed_when: NetworkConfig_result.rc != 0
when:
- tripleo_network_config_legacy_script|bool
- NetworkConfig_result.rc is defined
# os-net-config currently relies on the legacy network
# so we need to ensure it's enabled on boot. This should
# be removed when we switch to NetworkManager or replaced

View File

@ -48,3 +48,4 @@
async: "{{ tripleo_network_config_async_timeout }}"
poll: "{{ tripleo_network_config_async_poll }}"
register: NetworkConfig_result
when: not ansible_check_mode