Changeset - b1caa3b3c7ad
[Not reviewed]
1 2 1
Branko Majic (branko) - 4 years ago 2020-08-26 16:55:26
branko@majic.rs
MAR-150: Refactor the common role tests fixture handling:

- Use the cleanup playbook for removing the X.509 generated
keys/certificates.
- Drop the fixture.yml playbook, and include it inside of prepare
playbook (reduce unnecessary nesting).
4 files changed with 34 insertions and 26 deletions:
0 comments (0 inline, 0 general)
roles/common/molecule/default/cleanup.yml
Show inline comments
 
new file 100644
 
---
 

	
 
- name: Clean-up fixtures
 
  hosts: localhost
 
  connection: local
 
  gather_facts: false
 
  tasks:
 

	
 
    - name: Remove X.509 material
 
      file:
 
        path: "{{ item }}"
 
        state: absent
 
      with_items:
 
        - "tests/data/x509"
 
        - "tests/data/.gimmecert"
roles/common/molecule/default/fixtures.yml
Show inline comments
 
deleted file
roles/common/molecule/default/molecule.yml
Show inline comments
 
@@ -49,6 +49,8 @@ platforms:
 

	
 
provisioner:
 
  name: ansible
 
  playbooks:
 
    cleanup: cleanup.yml
 
  config_options:
 
    defaults:
 
      force_valid_group_names: "ignore"
roles/common/molecule/default/prepare.yml
Show inline comments
 
---
 

	
 
- name: Fixtures
 
  import_playbook: fixtures.yml
 
- name: Set-up fixtures
 
  hosts: localhost
 
  connection: local
 
  gather_facts: false
 
  tasks:
 

	
 
    - name: Initialise CA hierarchy
 
      command: "gimmecert init --ca-hierarchy-depth 2"
 
      args:
 
        creates: "tests/data/.gimmecert"
 
        chdir: "tests/data/"
 

	
 
    - name: Set-up link to generated X.509 material
 
      file:
 
        src: ".gimmecert"
 
        dest: "tests/data/x509"
 
        state: link
 

	
 
- name: Prepare
 
  hosts: all
0 comments (0 inline, 0 general)