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 a7606ecf051bd40b51050a4bb39926d8d078ce69..9aca8cc202e6f2138ebde2df7a45dc40cfbdff79 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/meta/main.yml b/meta/main.yml index eec9f4fd2509cb7d75d13b1d8f39a8ec853fb61d..b8c0d9f2eef96efedbfab5a8288130f1f735fa38 100644 --- a/meta/main.yml +++ b/meta/main.yml @@ -8,6 +8,7 @@ galaxy_info: - name: OpenBSD versions: - 5.9 + - 6.0 - name: Debian versions: - jessie diff --git a/molecule.yml b/molecule.yml index 52440869854d3ee3d7816f99bfa208a52819c147..97ca770e2408328f9209a21008607cab2979e98e 100644 --- a/molecule.yml +++ b/molecule.yml @@ -14,7 +14,7 @@ vagrant: type: virtualbox platforms: - name: openbsd - box: kaorimatz/openbsd-5.9-amd64 + box: kaorimatz/openbsd-6.0-amd64 - name: debian box: debian/jessie64 - name: ubuntu @@ -25,3 +25,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 786e234fec1ae09e23648f08de456ac601f96a91..b8dc3c36937f5acb4dd386d2277bbd597953dc63 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -1,7 +1,6 @@ --- # tasks file for ansible-role-ntp-client - -- name: Assert +- name: Assertions assert: that: ansible_os_family in [ 'Debian', 'OpenBSD' ] 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'