From 2dcd29823739f8eae2f5980fd2d6f43981cf05b1 Mon Sep 17 00:00:00 2001 From: Jan Benedikt Date: Mon, 10 Feb 2020 15:44:01 +0100 Subject: Adding Ubuntu support in Ansible - dns role Extending ansible playbooks of ubuntu support. Creating new test with Ubuntu image for Molecule in dns role. Issue-ID: OOM-1671 Signed-off-by: Jan Benedikt Change-Id: I414df46093fd300891b9df44e12a0225495cc906 --- ansible/roles/dns/molecule/ubuntu/group_vars | 1 + ansible/roles/dns/molecule/ubuntu/molecule.yml | 42 ++++++++++++++++++++++++++ ansible/roles/dns/tasks/main.yml | 6 ++++ 3 files changed, 49 insertions(+) create mode 120000 ansible/roles/dns/molecule/ubuntu/group_vars create mode 100644 ansible/roles/dns/molecule/ubuntu/molecule.yml diff --git a/ansible/roles/dns/molecule/ubuntu/group_vars b/ansible/roles/dns/molecule/ubuntu/group_vars new file mode 120000 index 00000000..e04e088f --- /dev/null +++ b/ansible/roles/dns/molecule/ubuntu/group_vars @@ -0,0 +1 @@ +../../../../group_vars/ \ No newline at end of file diff --git a/ansible/roles/dns/molecule/ubuntu/molecule.yml b/ansible/roles/dns/molecule/ubuntu/molecule.yml new file mode 100644 index 00000000..5428c04a --- /dev/null +++ b/ansible/roles/dns/molecule/ubuntu/molecule.yml @@ -0,0 +1,42 @@ +--- +dependency: + name: galaxy +driver: + name: docker +lint: + name: yamllint +platforms: + - name: infrastructure-server + image: molecule-${PREBUILD_PLATFORM_DISTRO:-ubuntu}:${PREBUILD_DISTRO_VERSION:-18.04} + pre_build_image: True + privileged: true + override_command: False + groups: + - infrastructure + volumes: + - /var/lib/docker +provisioner: + name: ansible + lint: + name: ansible-lint + env: + ANSIBLE_ROLES_PATH: ../../../../test/roles + ANSIBLE_LIBRARY: ../../../../library + playbooks: + prepare: ../default/prepare.yml + converge: ../default/playbook.yml + cleanup: ../default/cleanup.yml + inventory: + host_vars: + infrastructure-server: + cluster_ip: 127.0.0.1 + group_vars: + all: + app_name: onap + app_data_path: "/opt/{{ app_name }}" +scenario: + name: ubuntu +verifier: + name: testinfra + lint: + name: flake8 diff --git a/ansible/roles/dns/tasks/main.yml b/ansible/roles/dns/tasks/main.yml index 8a7f8bca..bfdd83b4 100644 --- a/ansible/roles/dns/tasks/main.yml +++ b/ansible/roles/dns/tasks/main.yml @@ -4,6 +4,12 @@ path: "{{ app_data_path }}/cfg" state: directory +- name: Stop systemd-resolved daemon - Ubuntu + systemd: + name: systemd-resolved + state: stopped + when: ansible_distribution in ["Ubuntu","Debian"] + - name: Create simulated hostnames file template: src: simulated_hosts.j2 -- cgit 1.2.3-korg