Changeset - 9882e078677e
[Not reviewed]
0 5 0
Branko Majic (branko) - 6 years ago 2018-05-27 19:22:06
branko@majic.rs
MAR-129: Updated Molecule configuration for the backup_client role:

- Updates necessary for use with Molecule version 2.14.
- Reference custom yamllint configuration file with custom rules.
- Fix YAML linting errors in Molecule's own files.
5 files changed with 15 insertions and 13 deletions:
0 comments (0 inline, 0 general)
roles/backup_client/molecule/default/create.yml
Show inline comments
 
@@ -2,7 +2,7 @@
 
- name: Create
 
  hosts: localhost
 
  connection: local
 
  gather_facts: False
 
  gather_facts: false
 
  no_log: "{{ not lookup('env', 'MOLECULE_DEBUG') | bool }}"
 
  vars:
 
    molecule_file: "{{ lookup('env', 'MOLECULE_FILE') }}"
roles/backup_client/molecule/default/destroy.yml
Show inline comments
 
@@ -3,7 +3,7 @@
 
- name: Destroy
 
  hosts: localhost
 
  connection: local
 
  gather_facts: False
 
  gather_facts: false
 
  no_log: "{{ not lookup('env', 'MOLECULE_DEBUG') | bool }}"
 
  vars:
 
    molecule_file: "{{ lookup('env', 'MOLECULE_FILE') }}"
roles/backup_client/molecule/default/molecule.yml
Show inline comments
 
@@ -9,6 +9,8 @@ driver:
 

	
 
lint:
 
  name: yamllint
 
  options:
 
    config-file: ../../.yamllint.yml
 

	
 
# NOTE: Hostnames are shortened because default values for backup
 
# usernames are calculated by appending hostname to the "bak-" string,
roles/backup_client/molecule/default/playbook.yml
Show inline comments
 
---
 

	
 
- hosts: parameters-mandatory
 
  become: yes
 
  become: true
 
  roles:
 
    - role: backup_client
 
      backup_encryption_key: "{{ lookup('file', 'tests/data/gnupg/parameters-mandatory.asc') }}"
 
@@ -14,7 +14,7 @@
 
      backup_ssh_key: "{{ lookup('file', 'tests/data/ssh/parameters-mandatory' ) }}"
 

	
 
- hosts: parameters-optional
 
  become: yes
 
  become: true
 

	
 
  roles:
 
    - role: backup_client
 
@@ -37,7 +37,7 @@
 

	
 
# Deploy a dummy pre-backup script for testing purposes.
 
- hosts: parameters-mandatory,parameters-optional
 
  become: yes
 
  become: true
 
  tasks:
 

	
 
    - name: Deploy pre-backup script
roles/backup_client/molecule/default/prepare.yml
Show inline comments
 
@@ -2,24 +2,24 @@
 

	
 
- name: Prepare
 
  hosts: all
 
  gather_facts: False
 
  gather_facts: false
 
  tasks:
 
    - name: Install python for Ansible
 
      raw: test -e /usr/bin/python || (apt -y update && apt install -y python-minimal)
 
      become: True
 
      changed_when: False
 
      become: true
 
      changed_when: false
 

	
 
- hosts: all
 
  become: yes
 
  become: true
 
  tasks:
 

	
 
    - name: Update all caches to avoid errors due to missing remote archives
 
      apt:
 
        update_cache: yes
 
      changed_when: False
 
        update_cache: true
 
      changed_when: false
 

	
 
- hosts: backup-server
 
  become: yes
 
  become: true
 
  tasks:
 

	
 
    - name: Deploy SSH server keys
 
@@ -72,7 +72,7 @@
 

	
 
    - name: Set-up port forwarding
 
      command: "iptables -t nat -A PREROUTING -p tcp -m tcp --dport '{{ item }}' -j REDIRECT --to-ports 22"
 
      changed_when: False
 
      changed_when: false
 
      with_items:
 
        - 2222
 
        - 3333
0 comments (0 inline, 0 general)