Files @ 40b5747adcb3
Branch filter:

Location: majic-ansible-roles/roles/php_website/molecule/default/prepare.yml

branko
MAR-129: Updated backup_server role tests:

- Move the 'ss' utility out of place in order to be able to test if
sockets are
open (seehttps://github.com/philpep/testinfra/pull/320).
- Updated tests to use correct mechanism for setting-up list of
machines where the tests should be run.
---

- name: Prepare
  hosts: all
  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

- hosts: all
  become: yes
  tasks:

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

    - name: Set-up /etc/hosts entries
      lineinfile:
        dest: /etc/hosts
        line: "{{ ansible_eth0.ipv4.address }} parameters-mandatory parameters-optional.local php-website"

    - name: Install curl for testing redirects and webpage content
      apt:
        name: curl
        state: installed

    - name: Install swaks for testing mail forwarding
      apt:
        name: swaks
        state: installed

    - name: Install Postfix for testing mail forwarding (Exim4 not covered)
      apt:
        name: postfix
        state: installed

    - name: Set-up group for an additional user
      group:
        name: user
        state: present

    - name: Set-up additional user for testing mail delivery
      user:
        name: user
        group: user
        shell: /bin/bash