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..e6b7fc91a863347569ebf3b72156c251ac8ff49b 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -10,3 +10,8 @@ sha: 94b506c144d4e22ebc1deef637a818db13bcaca5 hooks: - id: ansible-pre-commit +- repo: https://github.com/willthames/ansible-lint.git + sha: v3.3.3 + hooks: + - id: ansible-lint + files: \.(yaml|yml)$ diff --git a/README.rst b/README.rst index 3031477110d79e3d864e83d32f2075f413b85839..d5f3e91ff3ee5f0738d52695a80f4cf8d838005b 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 d5c1a6b080cd404b8fb2828e69929763153f38a7..fc907966ddb56bc8b84326186592d937609ebbed 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 e89c06274a72be878cf889e959767ab547eee579..4777a1c78d056daae34e30841eca3b8c3920092f 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -1,7 +1,8 @@ --- # tasks file for ansible-role-nspawn -- assert: +- name: Assertions + assert: that: - ansible_os_family == 'Debian' - ansible_distribution_version == 'stretch/sid' 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'