mirror of
https://github.com/geerlingguy/ansible-role-docker.git
synced 2024-11-18 19:10:43 +01:00
Fix broken Fedora 27 test, clean up uninstall task.
This commit is contained in:
parent
a42939be87
commit
d3afc01efc
@ -7,14 +7,11 @@ env:
|
|||||||
- ROLE_NAME: docker
|
- ROLE_NAME: docker
|
||||||
matrix:
|
matrix:
|
||||||
- MOLECULE_DISTRO: centos7
|
- MOLECULE_DISTRO: centos7
|
||||||
MOLECULE_DOCKER_COMMAND: /usr/lib/systemd/systemd
|
|
||||||
- MOLECULE_DISTRO: ubuntu1804
|
- MOLECULE_DISTRO: ubuntu1804
|
||||||
- MOLECULE_DISTRO: ubuntu1604
|
- MOLECULE_DISTRO: ubuntu1604
|
||||||
- MOLECULE_DISTRO: ubuntu1404
|
- MOLECULE_DISTRO: ubuntu1404
|
||||||
MOLECULE_DOCKER_COMMAND: /sbin/init
|
|
||||||
- MOLECULE_DISTRO: debian9
|
- MOLECULE_DISTRO: debian9
|
||||||
# - MOLECULE_DISTRO: fedora27
|
- MOLECULE_DISTRO: fedora27
|
||||||
# MOLECULE_DOCKER_COMMAND: /usr/lib/systemd/systemd
|
|
||||||
|
|
||||||
install:
|
install:
|
||||||
# Install test dependencies.
|
# Install test dependencies.
|
||||||
|
@ -9,8 +9,10 @@ lint:
|
|||||||
config-file: molecule/default/yaml-lint.yml
|
config-file: molecule/default/yaml-lint.yml
|
||||||
platforms:
|
platforms:
|
||||||
- name: instance
|
- name: instance
|
||||||
image: geerlingguy/docker-${MOLECULE_DISTRO:-centos7}-ansible
|
image: geerlingguy/docker-${MOLECULE_DISTRO:-centos7}-ansible:latest
|
||||||
command: ${MOLECULE_DOCKER_COMMAND:-"sleep infinity"}
|
command: ${MOLECULE_DOCKER_COMMAND:-""}
|
||||||
|
volumes:
|
||||||
|
- /sys/fs/cgroup:/sys/fs/cgroup:ro
|
||||||
privileged: true
|
privileged: true
|
||||||
pre_build_image: true
|
pre_build_image: true
|
||||||
provisioner:
|
provisioner:
|
||||||
|
@ -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'
|
|
@ -1,11 +1,10 @@
|
|||||||
---
|
---
|
||||||
- name: Ensure old versions of Docker are not installed.
|
- name: Ensure old versions of Docker are not installed.
|
||||||
package:
|
package:
|
||||||
name: '{{ item }}'
|
name:
|
||||||
state: absent
|
|
||||||
with_items:
|
|
||||||
- docker
|
- docker
|
||||||
- docker-engine
|
- docker-engine
|
||||||
|
state: absent
|
||||||
|
|
||||||
- name: Ensure dependencies are installed.
|
- name: Ensure dependencies are installed.
|
||||||
apt:
|
apt:
|
||||||
|
@ -1,12 +1,11 @@
|
|||||||
---
|
---
|
||||||
- name: Ensure old versions of Docker are not installed.
|
- name: Ensure old versions of Docker are not installed.
|
||||||
package:
|
package:
|
||||||
name: '{{ item }}'
|
name:
|
||||||
state: absent
|
|
||||||
with_items:
|
|
||||||
- docker
|
- docker
|
||||||
- docker-common
|
- docker-common
|
||||||
- docker-engine
|
- docker-engine
|
||||||
|
state: absent
|
||||||
|
|
||||||
- name: Add Docker GPG key.
|
- name: Add Docker GPG key.
|
||||||
rpm_key:
|
rpm_key:
|
||||||
|
Loading…
Reference in New Issue
Block a user