b21325d418f202bb920ad25a663d4641fdb82868
[oom/offline-installer.git] / ansible / roles / rancher / molecule / default / molecule.yml
1 ---
2 dependency:
3   name: galaxy
4 driver:
5   name: docker
6 lint:
7   name: yamllint
8 platforms:
9   - name: infrastructure-server
10     image: molecule-${PREBUILD_PLATFORM_DISTRO:-centos}:${PREBUILD_DISTRO_VERSION:-centos7.6}
11     pre_build_image: true
12     privileged: true
13     override_command: false
14     restart_policy: unless-stopped
15     volumes:
16       - /var/run/docker.sock:/var/run/docker.sock
17       - /var/lib/rancher:/var/lib/rancher:ro
18     groups:
19       - infrastructure
20     networks:
21       - name: rancher
22
23   - name: kubernetes-node-1
24     image: molecule-${PREBUILD_PLATFORM_DISTRO:-centos}:${PREBUILD_DISTRO_VERSION:-centos7.6}
25     pre_build_image: true
26     privileged: true
27     override_command: false
28     restart_policy: unless-stopped
29     volumes:
30       - /var/run/docker.sock:/var/run/docker.sock
31       - /var/lib/rancher:/var/lib/rancher:ro
32     groups:
33       - kubernetes
34     networks:
35       - name: rancher
36
37 provisioner:
38   name: ansible
39   env:
40     ANSIBLE_ROLES_PATH: ../../../../test/roles
41     ANSIBLE_LIBRARY: ../../../../library
42   inventory:
43     links:
44       group_vars: ../../../../group_vars
45     # 1) When running with molecule-dev container, use this definition and comment out localhost under host_vars (2)
46     hosts:
47       all:
48         hosts:
49           localhost:
50             ansible_connection: ssh
51             ansible_host: ${LOCALHOST_ANSIBLE_HOST:-""}
52             ansible_user: ${LOCALHOST_ANSIBLE_USER:-""}
53             ansible_password: ${LOCALHOST_ANSIBLE_PASSWORD:-""}
54             ansible_sudo_pass: ${LOCALHOST_ANSIBLE_SUDO_PASS:-""}
55             # end of 1)
56             # 2) When running with native molecule installation, use this definition and comment out hosts section under inventory (1)
57             # host_vars:
58             # localhost:
59             #   ansible_sudo_pass: ${LOCALHOST_ANSIBLE_SUDO_PASS:-""}
60             #   ansible_ssh_pass: ${LOCALHOST_ANSIBLE_PASSWORD:-""}
61             # End of 2)
62   lint:
63     name: ansible-lint
64 scenario:
65   name: default
66   test_sequence:
67     - lint
68     - cleanup
69     - destroy
70     - dependency
71     - syntax
72     - create
73     - prepare
74     - converge
75     # - idempotence
76     # --> Action: 'idempotence'
77     # ERROR: Idempotence test failed because of the following tasks:
78     # * [infrastructure-server] => rancher : Create rancher kubernetes environment
79     # * [kubernetes-node-1] => rancher : Add Rancher Agent
80     - side_effect
81     - verify
82     - cleanup
83     - destroy
84 verifier:
85   name: testinfra
86   lint:
87     name: flake8