started doing tests in ansible since testinfra is being deprecated
This commit is contained in:
parent
5c45d27b16
commit
8eb8c69c49
@ -1,5 +1,3 @@
|
||||
---
|
||||
# defaults file for import_vault_root_ca
|
||||
import_vault_root_ca_certificate_list:
|
||||
- url: "https://openstack01.ednz.fr:8200/v1/ednz-root-ca/ca"
|
||||
cert_name: "ednz_ca"
|
||||
import_vault_root_ca_certificate_list: {}
|
||||
|
7
molecule/with_custom_ca/converge.yml
Normal file
7
molecule/with_custom_ca/converge.yml
Normal file
@ -0,0 +1,7 @@
|
||||
---
|
||||
- name: Converge
|
||||
hosts: all
|
||||
tasks:
|
||||
- name: "Include ednxzu.import_vault_root_ca"
|
||||
ansible.builtin.include_role:
|
||||
name: "ednxzu.import_vault_root_ca"
|
4
molecule/with_custom_ca/group_vars/all.yml
Normal file
4
molecule/with_custom_ca/group_vars/all.yml
Normal file
@ -0,0 +1,4 @@
|
||||
---
|
||||
import_vault_root_ca_certificate_list:
|
||||
- url: "https://openstack01.ednz.fr:8200/v1/ednz-root-ca/ca"
|
||||
cert_name: "ednz_ca"
|
37
molecule/with_custom_ca/molecule.yml
Normal file
37
molecule/with_custom_ca/molecule.yml
Normal file
@ -0,0 +1,37 @@
|
||||
---
|
||||
dependency:
|
||||
name: galaxy
|
||||
options:
|
||||
requirements-file: ./requirements.yml
|
||||
driver:
|
||||
name: docker
|
||||
platforms:
|
||||
- name: instance
|
||||
image: geerlingguy/docker-${MOLECULE_TEST_OS}-ansible
|
||||
command: ""
|
||||
volumes:
|
||||
- /sys/fs/cgroup:/sys/fs/cgroup
|
||||
cgroupns_mode: host
|
||||
privileged: true
|
||||
pre_build_image: true
|
||||
provisioner:
|
||||
name: ansible
|
||||
config_options:
|
||||
defaults:
|
||||
remote_tmp: /tmp/.ansible
|
||||
verifier:
|
||||
name: ansible
|
||||
scenario:
|
||||
name: with_custom_ca
|
||||
test_sequence:
|
||||
- dependency
|
||||
- cleanup
|
||||
- destroy
|
||||
- syntax
|
||||
- create
|
||||
- prepare
|
||||
- converge
|
||||
- idempotence
|
||||
- verify
|
||||
- cleanup
|
||||
- destroy
|
3
molecule/with_custom_ca/requirements.yml
Normal file
3
molecule/with_custom_ca/requirements.yml
Normal file
@ -0,0 +1,3 @@
|
||||
---
|
||||
# requirements file for molecule
|
||||
roles: []
|
24
molecule/with_custom_ca/verify.yml
Normal file
24
molecule/with_custom_ca/verify.yml
Normal file
@ -0,0 +1,24 @@
|
||||
---
|
||||
# This is an example playbook to execute Ansible tests.
|
||||
|
||||
- name: Verify
|
||||
hosts: all
|
||||
gather_facts: false
|
||||
tasks:
|
||||
- name: "Test: directory /usr/local/share/ca-certificates"
|
||||
block:
|
||||
- name: "Stat directory /usr/local/share/ca-certificates"
|
||||
ansible.builtin.stat:
|
||||
path: "/usr/local/share/ca-certificates"
|
||||
register: usr_local_share_ca_certificates
|
||||
|
||||
- name: "Verify directory {{ import_vault_root_ca_cert_dir }}"
|
||||
ansible.builtin.assert:
|
||||
that:
|
||||
- usr_local_share_ca_certificates.stat.exists
|
||||
- usr_local_share_ca_certificates.stat.isdir
|
||||
- usr_local_share_ca_certificates.stat.pw_name == 'root'
|
||||
- usr_local_share_ca_certificates.stat.gr_name == 'root'
|
||||
- usr_local_share_ca_certificates.stat.mode == '0755'
|
||||
|
||||
- name: "Get certificate information"
|
Loading…
Reference in New Issue
Block a user