-
-
Notifications
You must be signed in to change notification settings - Fork 104
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8f4807e
commit fb650ad
Showing
12 changed files
with
90 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
*.retry | ||
tests/test.sh | ||
*/__pycache__ | ||
*.pyc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,27 @@ | ||
--- | ||
language: python | ||
services: docker | ||
|
||
env: | ||
- distro: centos7 | ||
- distro: ubuntu1604 | ||
global: | ||
- ROLE_NAME: dotfiles | ||
matrix: | ||
- MOLECULE_DISTRO: centos7 | ||
- MOLECULE_DISTRO: ubuntu1804 | ||
|
||
script: | ||
# Download test shim. | ||
- wget -O ${PWD}/tests/test.sh https://gist.githubusercontent.com/geerlingguy/73ef1e5ee45d8694570f334be385e181/raw/ | ||
- chmod +x ${PWD}/tests/test.sh | ||
install: | ||
# Install test dependencies. | ||
- pip install molecule docker | ||
|
||
before_script: | ||
# Use actual Ansible Galaxy role name for the project directory. | ||
- cd ../ | ||
- mv ansible-role-$ROLE_NAME geerlingguy.$ROLE_NAME | ||
- cd geerlingguy.$ROLE_NAME | ||
|
||
script: | ||
# Run tests. | ||
- ${PWD}/tests/test.sh | ||
- molecule test | ||
|
||
notifications: | ||
webhooks: https://galaxy.ansible.com/api/v1/notifications/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
--- | ||
dependency: | ||
name: galaxy | ||
driver: | ||
name: docker | ||
lint: | ||
name: yamllint | ||
options: | ||
config-file: molecule/default/yaml-lint.yml | ||
platforms: | ||
- name: instance | ||
image: geerlingguy/docker-${MOLECULE_DISTRO:-centos7}-ansible | ||
command: ${MOLECULE_DOCKER_COMMAND:-"sleep infinity"} | ||
privileged: true | ||
pre_build_image: true | ||
provisioner: | ||
name: ansible | ||
lint: | ||
name: ansible-lint | ||
playbooks: | ||
converge: ${MOLECULE_PLAYBOOK:-playbook.yml} | ||
scenario: | ||
name: default | ||
verifier: | ||
name: testinfra | ||
lint: | ||
name: flake8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,13 @@ | ||
--- | ||
- hosts: all | ||
- name: Converge | ||
hosts: all | ||
become: true | ||
|
||
pre_tasks: | ||
- name: Update apt cache. | ||
apt: update_cache=yes cache_valid_time=600 | ||
when: ansible_os_family == 'Debian' | ||
|
||
roles: | ||
- geerlingguy.git | ||
- role_under_test | ||
- role: geerlingguy.git | ||
- role: geerlingguy.dotfiles |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
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' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
extends: default | ||
rules: | ||
line-length: | ||
max: 120 | ||
level: warning |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.