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