Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update test to Molecule v3 #71

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ name = "pypi"
pre_commit = "*"

[packages]
molecule = "*"
docker-py = "*"
molecule = {extras = ["docker"],version = "*"}
ansible-lint = "*"
yamllint = "*"

[requires]
python_version = "2.7"
15 changes: 2 additions & 13 deletions molecule/default/playbook.yml → molecule/default/converge.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,13 @@
---

- hosts: all
tasks:
- debug:
msg: "System {{ inventory_hostname }} has OS {{ ansible_distribution}}-{{ ansible_distribution_major_version }}"

- hosts: all
tasks:
- name: create a group of all hosts by operating system
group_by:
key: "{{ ansible_distribution}}-{{ ansible_distribution_major_version }}"

- hosts: CentOS-6
- hosts: CentOS_6
tasks:
- name: install initscripts
package:
name: initscripts
state: present

- hosts: CentOS-7
- hosts: CentOS_7
tasks:
- name: remove requiretty from /etc/sudoers
lineinfile:
Expand Down
16 changes: 9 additions & 7 deletions molecule/default/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@ platforms:
image: milcom/centos7-systemd:latest
privileged: True

ansible:
playbook: playbook.yml
# ansible:
# playbook: playbook.yml

lint:
name: yamllint
enabled: False
# lint:
# name: yamllint
# enabled: False

provisioner:
name: ansible
Expand Down Expand Up @@ -75,8 +75,10 @@ provisioner:
SHUTDOWN_WAIT: 2
wildfly_temp_dir: /opt/wildfly/standalone/tmp

lint:
name: ansible-lint
lint: |
set -e
yamllint .
ansible-lint

scenario:
name: default
12 changes: 12 additions & 0 deletions molecule/default/prepare.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---

- hosts: all
tasks:
- debug:
msg: "System {{ inventory_hostname }} has OS {{ ansible_distribution}}-{{ ansible_distribution_major_version }}"

- hosts: all
tasks:
- name: create a group of all hosts by operating system
group_by:
key: "{{ ansible_distribution}}_{{ ansible_distribution_major_version }}"