Skip to content
Snippets Groups Projects
Commit 759ece33 authored by nimrod's avatar nimrod
Browse files

Merge branch 'master' of /home/nimrod/Documents/Shore/Ansible/ansible-role-example

# Conflicts:
#	meta/main.yml
#	molecule.yml
#	tasks/main.yml
#	tests/playbook.yml
parents f71c5e50 1f52f9ae
No related branches found
No related tags found
No related merge requests found
...@@ -6,17 +6,30 @@ ...@@ -6,17 +6,30 @@
- id: check-xml - id: check-xml
- id: check-yaml - id: check-yaml
- id: check-merge-conflict - id: check-merge-conflict
- id: flake8
- id: check-symlinks
- repo: https://www.shore.co.il/git/ansible-pre-commit - repo: https://www.shore.co.il/git/ansible-pre-commit
sha: v0.4.0 sha: 0fadd691465b97db8992cfc66650f630e433324b
hooks: hooks:
- id: ansible-syntax-check - id: ansible-syntax-check
always_run: true always_run: true
files: tests/playbook.yml files: tests/playbook.yml
args: ['tests/playbook.yml'] args:
- tests/playbook.yml
- repo: https://github.com/willthames/ansible-lint - repo: https://github.com/willthames/ansible-lint
sha: v3.4.4 sha: 959ab0f525e9abb19cf75f34381015cf33695f61
hooks: hooks:
- id: ansible-lint - id: ansible-lint
always_run: true always_run: true
files: tests/playbook.yml files: tests/playbook.yml
args: ['tests/playbook.yml'] args:
- tests/playbook.yml
- repo: local
hooks:
- id: piprot
name: piprot
description: Check up-to-date Python requirements
language: system
entry: piprot --quiet --outdated tests/requirements.txt
files: requirements.txt
always_run: true
...@@ -6,7 +6,8 @@ Provision Systemd-nspawn. ...@@ -6,7 +6,8 @@ Provision Systemd-nspawn.
Requirements Requirements
------------ ------------
See :code:`meta/main.yml` and assertions at top of :code:`tasks/main.yml`. See :code:`meta/main.yml`, :code:`tests/requirements.yml` and assertions at
the top of :code:`tasks/main.yml`.
Role Variables Role Variables
-------------- --------------
...@@ -26,17 +27,21 @@ See :code:`tests/playbook.yml`. ...@@ -26,17 +27,21 @@ See :code:`tests/playbook.yml`.
Testing Testing
------- -------
To install the dependencies: Testing requires Virtualbox and Vagrant and Python 2.7. Install the Python
dependencies, add pre-commit hooks by running:
.. code:: shell .. code:: shell
ansible-galaxy install git+file://$(pwd),$(git rev-parse --abbrev-ref HEAD) -p .molecule/roles pip install -r tests/requirements.txt
pre-commit install
To run the full test suite: To run the full test suite:
.. code:: shell .. code:: shell
molecule test ansible-galaxy install git+file://$(pwd),$(git rev-parse --abbrev-ref HEAD) -p .molecule/roles
molecule test --platform all
pre-commit run --all-files
License License
------- -------
......
[defaults] [defaults]
library = library
host_key_checking = False host_key_checking = False
retry_files_enabled = False retry_files_enabled = False
roles_path = roles:../:../../:.molecule/roles roles_path = .molecule/roles:.molecule/../roles:../:../../
command_warnings = True command_warnings = True
deprecation_warnings = True deprecation_warnings = True
[ssh_connection]
pipelining = True
...@@ -12,4 +12,4 @@ galaxy_info: ...@@ -12,4 +12,4 @@ galaxy_info:
dependencies: dependencies:
- src: https://www.shore.co.il/git/ansible-role-networkd - src: https://www.shore.co.il/git/ansible-role-networkd
scm: git scm: git
role: networkd name: networkd
--- ---
ansible: ansible:
verbose: v verbose: vv
playbook: tests/playbook.yml playbook: tests/playbook.yml
diff: True diff: True
config_file: ../ansible.cfg
molecule:
testinfra_dir: tests
ansible_config_template: ansible.cfg
vagrant: vagrant:
providers: providers:
......
ansible==2.2.0.0
testinfra==1.4.3
molecule==1.13.0
ansible-lint==3.4.4
pre-commit==0.9.3
piprot==0.9.7
---
- src: https://www.shore.co.il/git/ansible-role-openbsd-bootstrap
scm: git
name: openbsd_bootstrap
- src: https://www.shore.co.il/git/ansible-role-debian-bootstrap
scm: git
name: debian_bootstrap
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment