diff --git a/tests/ansible.cfg b/tests/ansible.cfg index cb234805..8a266959 100644 --- a/tests/ansible.cfg +++ b/tests/ansible.cfg @@ -1,3 +1,3 @@ [defaults] roles_path = ../../ - +remote_tmp = ../.ansible/tmp/ diff --git a/tests/inventory b/tests/inventory index df8b5f69..6c0833a9 100644 --- a/tests/inventory +++ b/tests/inventory @@ -1,2 +1,2 @@ [all] -localhost ansible_connection=local +localhost ansible_connection=local ansible_become=True diff --git a/tests/test.yml b/tests/test.yml index cd7c4e30..90018e5d 100644 --- a/tests/test.yml +++ b/tests/test.yml @@ -16,6 +16,18 @@ - name: Playbook for role testing hosts: localhost connection: local + pre_tasks: + - name: Ensure root ssh key + user: + name: "{{ ansible_env.USER | default('root') }}" + generate_ssh_key: "yes" + ssh_key_bits: 2048 + ssh_key_file: ".ssh/id_rsa" + - name: get the calling users key + command: cat ~/.ssh/id_rsa.pub + register: key_get + - set_fact: + lxc_container_ssh_key: key_get.stdout roles: - role: "{{ rolename | basename }}" lxc_net_bridge: lxcbr0