From d3afc01efcb60a548e342d0b41b799ce9bbfdd81 Mon Sep 17 00:00:00 2001 From: Jeff Geerling Date: Mon, 22 Oct 2018 23:32:38 -0500 Subject: [PATCH] Fix broken Fedora 27 test, clean up uninstall task. --- .travis.yml | 5 +---- molecule/default/molecule.yml | 6 ++++-- molecule/default/tests/test_default.py | 14 -------------- tasks/setup-Debian.yml | 7 +++---- tasks/setup-RedHat.yml | 9 ++++----- 5 files changed, 12 insertions(+), 29 deletions(-) delete mode 100644 molecule/default/tests/test_default.py diff --git a/.travis.yml b/.travis.yml index f023be6..a8851b7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,14 +7,11 @@ env: - ROLE_NAME: docker matrix: - MOLECULE_DISTRO: centos7 - MOLECULE_DOCKER_COMMAND: /usr/lib/systemd/systemd - MOLECULE_DISTRO: ubuntu1804 - MOLECULE_DISTRO: ubuntu1604 - MOLECULE_DISTRO: ubuntu1404 - MOLECULE_DOCKER_COMMAND: /sbin/init - MOLECULE_DISTRO: debian9 - # - MOLECULE_DISTRO: fedora27 - # MOLECULE_DOCKER_COMMAND: /usr/lib/systemd/systemd + - MOLECULE_DISTRO: fedora27 install: # Install test dependencies. diff --git a/molecule/default/molecule.yml b/molecule/default/molecule.yml index 0339702..5322c4c 100644 --- a/molecule/default/molecule.yml +++ b/molecule/default/molecule.yml @@ -9,8 +9,10 @@ lint: config-file: molecule/default/yaml-lint.yml platforms: - name: instance - image: geerlingguy/docker-${MOLECULE_DISTRO:-centos7}-ansible - command: ${MOLECULE_DOCKER_COMMAND:-"sleep infinity"} + image: geerlingguy/docker-${MOLECULE_DISTRO:-centos7}-ansible:latest + command: ${MOLECULE_DOCKER_COMMAND:-""} + volumes: + - /sys/fs/cgroup:/sys/fs/cgroup:ro privileged: true pre_build_image: true provisioner: diff --git a/molecule/default/tests/test_default.py b/molecule/default/tests/test_default.py deleted file mode 100644 index eedd64a..0000000 --- a/molecule/default/tests/test_default.py +++ /dev/null @@ -1,14 +0,0 @@ -import os - -import testinfra.utils.ansible_runner - -testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner( - os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all') - - -def test_hosts_file(host): - f = host.file('/etc/hosts') - - assert f.exists - assert f.user == 'root' - assert f.group == 'root' diff --git a/tasks/setup-Debian.yml b/tasks/setup-Debian.yml index 914797e..23a49ae 100644 --- a/tasks/setup-Debian.yml +++ b/tasks/setup-Debian.yml @@ -1,11 +1,10 @@ --- - name: Ensure old versions of Docker are not installed. package: - name: '{{ item }}' + name: + - docker + - docker-engine state: absent - with_items: - - docker - - docker-engine - name: Ensure dependencies are installed. apt: diff --git a/tasks/setup-RedHat.yml b/tasks/setup-RedHat.yml index 1d44e7b..0cd1a50 100644 --- a/tasks/setup-RedHat.yml +++ b/tasks/setup-RedHat.yml @@ -1,12 +1,11 @@ --- - name: Ensure old versions of Docker are not installed. package: - name: '{{ item }}' + name: + - docker + - docker-common + - docker-engine state: absent - with_items: - - docker - - docker-common - - docker-engine - name: Add Docker GPG key. rpm_key: