tripleo-ansible/tripleo_ansible/roles/tripleo-network-config/molecule/default/playbook.yml

61 lines
1.9 KiB
YAML

---
# Copyright 2020 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: 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 }}"
- name: Check return code content
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