diff --git a/.molecule/group_vars/all b/.molecule/group_vars/all deleted file mode 100644 index b5dce2f7aeb7225bea7a972bcb406ba3cca1b26d..0000000000000000000000000000000000000000 --- a/.molecule/group_vars/all +++ /dev/null @@ -1,3 +0,0 @@ -five: 5 -six: 6 -eleven: '{{ five + six }}' diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 6274aa01b223aa43f1be946e2da2470f5d90e446..d3016f7593bb9f6586c37e14838d741a23349191 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,12 +1,22 @@ - repo: https://github.com/pre-commit/pre-commit-hooks - sha: 6dfcb89af3c9b4d172cc2e5a8a2fa0f54615a338 + sha: 7539d8bd1a00a3c1bfd34cdb606d3a6372e83469 hooks: - id: check-added-large-files - id: check-json - id: check-xml - id: check-yaml - id: check-merge-conflict -- repo: https://www.shore.co.il/git/ansible-pre-commit/ - sha: 94b506c144d4e22ebc1deef637a818db13bcaca5 +- repo: https://www.shore.co.il/git/ansible-pre-commit + sha: v0.4.0 hooks: - - id: ansible-pre-commit + - id: ansible-syntax-check + always_run: true + files: tests/playbook.yml + args: ['tests/playbook.yml'] +- repo: https://github.com/willthames/ansible-lint + sha: v3.4.4 + hooks: + - id: ansible-lint + always_run: true + files: tests/playbook.yml + args: ['tests/playbook.yml'] diff --git a/README.rst b/README.rst index 25bace670c791cf31f12655bef030f24e08b73ec..4b1d593b7d762e1e23c2a61b707b54859c3a9ae4 100644 --- a/README.rst +++ b/README.rst @@ -30,7 +30,7 @@ To install the dependencies: .. code:: shell - ansible-galaxy install git+file://$(pwd),$(git rev-parse --abbrev-ref HEAD) + ansible-galaxy install git+file://$(pwd),$(git rev-parse --abbrev-ref HEAD) -p .molecule/roles To run the full test suite: diff --git a/ansible.cfg b/ansible.cfg index e9ff55d11e12f188e2f551060e6d149e870a10bd..10b3da5cfa1edbc2186229872bd129f0e34222c8 100644 --- a/ansible.cfg +++ b/ansible.cfg @@ -1,6 +1,6 @@ [defaults] host_key_checking = False retry_files_enabled = False -roles_path = .molecule/roles:../ +roles_path = roles:../:../../:.molecule/roles command_warnings = True deprecation_warnings = True diff --git a/molecule.yml b/molecule.yml index 049646d69d13ac96bc259ed995ad6922a1f394f9..b70275f5133d8299ca06b11d85c242f98f7440cd 100644 --- a/molecule.yml +++ b/molecule.yml @@ -21,3 +21,6 @@ vagrant: append_platform_to_hostname: yes raw_config_args: - 'vm.synced_folder ".", "/vagrant", disabled: true' + - 'vbguest.auto_update = false' + - 'landrush.enabled = false' + - 'landrush_ip.override = false' diff --git a/tasks/main.yml b/tasks/main.yml index 6388ee2440248c9bf5305c921e38d308d86307f2..dc284b4ec6f61c542da250edf20c84357ddad7be 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -1,7 +1,6 @@ --- # tasks file for ansible-role-ufw - -- name: Assert +- name: Assertions assert: that: ansible_pkg_mgr == 'apt' diff --git a/tests/test_example.py b/tests/test_example.py new file mode 100644 index 0000000000000000000000000000000000000000..12d4c7a5294fc8128e8ae695e8afaaa62a002f9b --- /dev/null +++ b/tests/test_example.py @@ -0,0 +1,7 @@ +def test_example(Command): + assert Command('uname').rc == 0 + + +def test_root(Command, Sudo): + with Sudo(): + assert Command('whoami').stdout == 'root'