Changeset - 1f535da3e694
[Not reviewed]
0 1 2
Branko Majic (branko) - 6 years ago 2018-05-27 19:36:24
branko@majic.rs
MAR-129: Updated backup_client tests to use variables from group_vars.
3 files changed with 29 insertions and 32 deletions:
0 comments (0 inline, 0 general)
roles/backup_client/molecule/default/group_vars/parameters-mandatory.yml
Show inline comments
 
new file 100644
 
---
 

	
 
backup_encryption_key: "{{ lookup('file', 'tests/data/gnupg/parameters-mandatory.asc') }}"
 
backup_server: 10.31.127.10
 
backup_server_host_ssh_public_keys:
 
  - "{{ lookup('file', 'tests/data/ssh/server_dsa.pub') }}"
 
  - "{{ lookup('file', 'tests/data/ssh/server_rsa.pub') }}"
 
  - "{{ lookup('file', 'tests/data/ssh/server_ed25519.pub') }}"
 
  - "{{ lookup('file', 'tests/data/ssh/server_ecdsa.pub') }}"
 
backup_ssh_key: "{{ lookup('file', 'tests/data/ssh/parameters-mandatory' ) }}"
roles/backup_client/molecule/default/group_vars/parameters-optional.yml
Show inline comments
 
new file 100644
 
---
 

	
 
backup_additional_encryption_keys:
 
  - "{{ lookup('file', 'tests/data/gnupg/additional_encryption_key_1.asc') }}"
 
  - "{{ lookup('file', 'tests/data/gnupg/additional_encryption_key_2.asc') }}"
 
  - "{{ lookup('file', 'tests/data/gnupg/additional_encryption_key_3.asc') }}"
 
backup_client_username: backupuser
 
backup_encryption_key: "{{ lookup('file', 'tests/data/gnupg/parameters-optional.asc') }}"
 
backup_server: 10.31.127.10
 
backup_server_destination: "/duplicity/{{ inventory_hostname }}"
 
backup_server_host_ssh_public_keys:
 
  - "{{ lookup('file', 'tests/data/ssh/server_dsa.pub') }}"
 
  - "{{ lookup('file', 'tests/data/ssh/server_rsa.pub') }}"
 
  - "{{ lookup('file', 'tests/data/ssh/server_ed25519.pub') }}"
 
  - "{{ lookup('file', 'tests/data/ssh/server_ecdsa.pub') }}"
 
backup_server_port: 3333
 
backup_ssh_key: "{{ lookup('file', 'tests/data/ssh/parameters-optional' ) }}"
roles/backup_client/molecule/default/playbook.yml
Show inline comments
 
---
 

	
 
- hosts: parameters-mandatory
 
  become: true
 
  roles:
 
    - role: backup_client
 
      backup_encryption_key: "{{ lookup('file', 'tests/data/gnupg/parameters-mandatory.asc') }}"
 
      backup_server: 10.31.127.10
 
      backup_server_host_ssh_public_keys:
 
        - "{{ lookup('file', 'tests/data/ssh/server_dsa.pub') }}"
 
        - "{{ lookup('file', 'tests/data/ssh/server_rsa.pub') }}"
 
        - "{{ lookup('file', 'tests/data/ssh/server_ed25519.pub') }}"
 
        - "{{ lookup('file', 'tests/data/ssh/server_ecdsa.pub') }}"
 
      backup_ssh_key: "{{ lookup('file', 'tests/data/ssh/parameters-mandatory' ) }}"
 

	
 
- hosts: parameters-optional
 
- hosts: parameters-mandatory,parameters-optional
 
  become: true
 

	
 
  roles:
 
    - role: backup_client
 
      backup_additional_encryption_keys:
 
        - "{{ lookup('file', 'tests/data/gnupg/additional_encryption_key_1.asc') }}"
 
        - "{{ lookup('file', 'tests/data/gnupg/additional_encryption_key_2.asc') }}"
 
        - "{{ lookup('file', 'tests/data/gnupg/additional_encryption_key_3.asc') }}"
 
      backup_client_username: backupuser
 
      backup_encryption_key: "{{ lookup('file', 'tests/data/gnupg/parameters-optional.asc') }}"
 
      backup_server: 10.31.127.10
 
      backup_server_destination: "/duplicity/{{ inventory_hostname }}"
 
      backup_server_host_ssh_public_keys:
 
        - "{{ lookup('file', 'tests/data/ssh/server_dsa.pub') }}"
 
        - "{{ lookup('file', 'tests/data/ssh/server_rsa.pub') }}"
 
        - "{{ lookup('file', 'tests/data/ssh/server_ed25519.pub') }}"
 
        - "{{ lookup('file', 'tests/data/ssh/server_ecdsa.pub') }}"
 
      backup_server_port: 3333
 
      backup_ssh_key: "{{ lookup('file', 'tests/data/ssh/parameters-optional' ) }}"
 

	
 
    - backup_client
 

	
 
# Deploy a dummy pre-backup script for testing purposes.
 
- hosts: parameters-mandatory,parameters-optional
0 comments (0 inline, 0 general)