diff --git a/.github/workflows/molecule.yml b/.github/workflows/molecule.yml index 380e377..7b27bf3 100644 --- a/.github/workflows/molecule.yml +++ b/.github/workflows/molecule.yml @@ -13,11 +13,11 @@ jobs: runs-on: ubuntu-latest steps: - name: checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: path: "${{ github.repository }}" - name: molecule - uses: robertdebock/molecule-action@2.6.3 + uses: robertdebock/molecule-action@4.0.9 with: command: lint test: @@ -29,19 +29,18 @@ jobs: scenario: - php7.4 - php8.0 - - default # aka php81modern. Only uses 8.1 style lists for all php versions. + - default # PHP 8.1 and beyond. Only uses 8.1 style lists for all php versions. - php81legacy # Mixes new 8.1 style list and keeps pre-8.1 module lists. image: - - geerlingguy/docker-ubuntu2204-ansible:latest - - geerlingguy/docker-ubuntu2004-ansible:latest - - geerlingguy/docker-ubuntu1804-ansible:latest + - registry.gitlab.com/aussielunix/ansible/molecule-containers/ubuntu:jammy + - registry.gitlab.com/aussielunix/ansible/molecule-containers/ubuntu:focal steps: - name: checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: path: "${{ github.repository }}" - name: molecule - uses: robertdebock/molecule-action@2.6.3 + uses: robertdebock/molecule-action@4.0.9 with: options: parallel scenario: "${{ matrix.scenario }}" diff --git a/molecule/default/converge.yml b/molecule/default/converge.yml index f07ec43..466dae9 100644 --- a/molecule/default/converge.yml +++ b/molecule/default/converge.yml @@ -5,19 +5,5 @@ vars_files: ./vars.yml - pre_tasks: - - - name: Update apt cache. - apt: update_cache=true cache_valid_time=600 - changed_when: false - - - name: Ensure dirmngr is installed (gnupg dependency). - apt: - name: dirmngr - state: present - - - name: Add repository for PHP - apt_repository: repo='ppa:ondrej/php' - roles: - role: ansible-role-php diff --git a/molecule/default/molecule.yml b/molecule/default/molecule.yml index 19043f6..c789bb0 100644 --- a/molecule/default/molecule.yml +++ b/molecule/default/molecule.yml @@ -1,23 +1,31 @@ --- +role_name_check: 1 dependency: name: galaxy driver: name: docker platforms: - name: instance - image: ${MOLECULE_DOCKER_IMAGE:-'geerlingguy/docker-ubuntu2204-ansible:latest'} - # command: ${MOLECULE_DOCKER_COMMAND:-""} - volumes: - - /sys/fs/cgroup:/sys/fs/cgroup:ro + image: "registry.gitlab.com/aussielunix/ansible/molecule-containers/${MOLECULE_DISTRO:-ubuntu:jammy}" privileged: true pre_build_image: true -# instance_raw_config_args: -# - "vm.network 'forwarded_port', guest: 80, host: 8088" + override_command: false + tmpfs: + - /run + - /tmp provisioner: name: ansible playbooks: converge: ${MOLECULE_PLAYBOOK:-converge.yml} + env: + ANSIBLE_VERBOSITY: ${MOLECULE_ANSIBLE_VERBOSITY:-0} + PY_COLORS: '1' + ANSIBLE_FORCE_COLOR: '1' verifier: name: ansible +# env: +# ANSIBLE_VERBOSITY: ${MOLECULE_ANSIBLE_VERBOSITY:-0} +# PY_COLORS: '1' +# ANSIBLE_FORCE_COLOR: '1' scenario: name: default diff --git a/molecule/default/prepare.yml b/molecule/default/prepare.yml new file mode 100644 index 0000000..7337695 --- /dev/null +++ b/molecule/default/prepare.yml @@ -0,0 +1,17 @@ +--- +- name: Prepare + hosts: all + become: true + + vars_files: ./vars.yml + + tasks: + + - name: Update apt cache. + apt: update_cache=true cache_valid_time=600 + changed_when: false + + - name: Ensure dirmngr is installed (gnupg dependency). + apt: + name: dirmngr + state: present diff --git a/molecule/php7.4/molecule.yml b/molecule/php7.4/molecule.yml index 5403dab..6656a9f 100644 --- a/molecule/php7.4/molecule.yml +++ b/molecule/php7.4/molecule.yml @@ -1,25 +1,31 @@ --- +role_name_check: 1 dependency: name: galaxy driver: name: docker platforms: - name: instance - image: ${MOLECULE_DOCKER_IMAGE:-'geerlingguy/docker-ubuntu1804-ansible:latest'} - # command: ${MOLECULE_DOCKER_COMMAND:-""} - volumes: - - /sys/fs/cgroup:/sys/fs/cgroup:ro + image: "registry.gitlab.com/aussielunix/ansible/molecule-containers/${MOLECULE_DISTRO:-ubuntu:jammy}" privileged: true pre_build_image: true + override_command: false + tmpfs: + - /run + - /tmp provisioner: name: ansible playbooks: converge: ${MOLECULE_PLAYBOOK:-converge.yml} + env: + ANSIBLE_VERBOSITY: ${MOLECULE_ANSIBLE_VERBOSITY:-0} + PY_COLORS: '1' + ANSIBLE_FORCE_COLOR: '1' verifier: name: ansible -lint: | - set -e - yamllint -d relaxed . -# ansible-lint . @TODO uncomment and address issues, which are out of scope for this feature branch. +# env: +# ANSIBLE_VERBOSITY: ${MOLECULE_ANSIBLE_VERBOSITY:-0} +# PY_COLORS: '1' +# ANSIBLE_FORCE_COLOR: '1' scenario: name: php7.4 diff --git a/molecule/php8.0/molecule.yml b/molecule/php8.0/molecule.yml index 5a82d3f..81464d2 100644 --- a/molecule/php8.0/molecule.yml +++ b/molecule/php8.0/molecule.yml @@ -1,25 +1,31 @@ --- +role_name_check: 1 dependency: name: galaxy driver: name: docker platforms: - name: instance - image: ${MOLECULE_DOCKER_IMAGE:-'geerlingguy/docker-ubuntu1804-ansible:latest'} - # command: ${MOLECULE_DOCKER_COMMAND:-""} - volumes: - - /sys/fs/cgroup:/sys/fs/cgroup:ro + image: "registry.gitlab.com/aussielunix/ansible/molecule-containers/${MOLECULE_DISTRO:-ubuntu:jammy}" privileged: true pre_build_image: true + override_command: false + tmpfs: + - /run + - /tmp provisioner: name: ansible playbooks: converge: ${MOLECULE_PLAYBOOK:-converge.yml} + env: + ANSIBLE_VERBOSITY: ${MOLECULE_ANSIBLE_VERBOSITY:-0} + PY_COLORS: '1' + ANSIBLE_FORCE_COLOR: '1' verifier: name: ansible -lint: | - set -e - yamllint -d relaxed . -# ansible-lint . @TODO uncomment and address issues, which are out of scope for this feature branch. +# env: +# ANSIBLE_VERBOSITY: ${MOLECULE_ANSIBLE_VERBOSITY:-0} +# PY_COLORS: '1' +# ANSIBLE_FORCE_COLOR: '1' scenario: name: php8.0 diff --git a/molecule/php81legacy/converge.yml b/molecule/php81legacy/converge.yml index f07ec43..f9ed48b 100644 --- a/molecule/php81legacy/converge.yml +++ b/molecule/php81legacy/converge.yml @@ -16,8 +16,5 @@ name: dirmngr state: present - - name: Add repository for PHP - apt_repository: repo='ppa:ondrej/php' - roles: - role: ansible-role-php diff --git a/molecule/php81legacy/molecule.yml b/molecule/php81legacy/molecule.yml index 576a56a..63b69a9 100644 --- a/molecule/php81legacy/molecule.yml +++ b/molecule/php81legacy/molecule.yml @@ -1,23 +1,31 @@ --- +role_name_check: 1 dependency: name: galaxy driver: name: docker platforms: - name: instance - image: ${MOLECULE_DOCKER_IMAGE:-'geerlingguy/docker-ubuntu2204-ansible:latest'} - # command: ${MOLECULE_DOCKER_COMMAND:-""} - volumes: - - /sys/fs/cgroup:/sys/fs/cgroup:ro + image: "registry.gitlab.com/aussielunix/ansible/molecule-containers/${MOLECULE_DISTRO:-ubuntu:jammy}" privileged: true pre_build_image: true -# instance_raw_config_args: -# - "vm.network 'forwarded_port', guest: 80, host: 8088" + override_command: false + tmpfs: + - /run + - /tmp provisioner: name: ansible playbooks: converge: ${MOLECULE_PLAYBOOK:-converge.yml} + env: + ANSIBLE_VERBOSITY: ${MOLECULE_ANSIBLE_VERBOSITY:-0} + PY_COLORS: '1' + ANSIBLE_FORCE_COLOR: '1' verifier: name: ansible +# env: +# ANSIBLE_VERBOSITY: ${MOLECULE_ANSIBLE_VERBOSITY:-0} +# PY_COLORS: '1' +# ANSIBLE_FORCE_COLOR: '1' scenario: name: php81legacy diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..442a8a0 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,2 @@ +# pip requirements for testing +molecule[docker]