diff --git a/CHANGELOG.md b/CHANGELOG.md index 8ebbf9d..4baa0f4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.2.0] - 2020-04-27 + +### Added + +- Add bundle playbooks so that the only required config is `molecule.yml` + ## [0.1.0] - 2020-04-27 ### Added diff --git a/integration/molecule/default/converge.yml b/integration/molecule/default/converge.yml deleted file mode 100644 index df058fd..0000000 --- a/integration/molecule/default/converge.yml +++ /dev/null @@ -1,7 +0,0 @@ ---- -- name: Converge - hosts: all - tasks: - - name: "Include integration" - include_role: - name: "integration" diff --git a/molecule_hetznercloud/playbooks/converge.yml b/molecule_hetznercloud/playbooks/converge.yml new file mode 100644 index 0000000..fecf1c8 --- /dev/null +++ b/molecule_hetznercloud/playbooks/converge.yml @@ -0,0 +1,7 @@ +--- +- name: Converge + hosts: all + tasks: + - name: "Include {{ cookiecutter.role_name }}" + include_role: + name: "{{ cookiecutter.role_name }}" diff --git a/integration/molecule/default/create.yml b/molecule_hetznercloud/playbooks/create.yml similarity index 87% rename from integration/molecule/default/create.yml rename to molecule_hetznercloud/playbooks/create.yml index 7e541dd..7bbcfbc 100644 --- a/integration/molecule/default/create.yml +++ b/molecule_hetznercloud/playbooks/create.yml @@ -54,13 +54,15 @@ - name: Populate instance config dict set_fact: - instance_conf_dict: { - 'instance': "{{ item.hcloud_server.name }}", - 'ssh_key_name': "{{ ssh_key_name }}", - 'address': "{{ item.hcloud_server.ipv4_address }}", - 'user': "{{ ssh_user }}", - 'port': "{{ ssh_port }}", - 'identity_file': "{{ ssh_path }}", } + instance_conf_dict: + { + "instance": "{{ item.hcloud_server.name }}", + "ssh_key_name": "{{ ssh_key_name }}", + "address": "{{ item.hcloud_server.ipv4_address }}", + "user": "{{ ssh_user }}", + "port": "{{ ssh_port }}", + "identity_file": "{{ ssh_path }}", + } with_items: "{{ hetzner_jobs.results }}" register: instance_config_dict when: server.changed | bool diff --git a/integration/molecule/default/destroy.yml b/molecule_hetznercloud/playbooks/destroy.yml similarity index 95% rename from integration/molecule/default/destroy.yml rename to molecule_hetznercloud/playbooks/destroy.yml index aae4ed6..c23c01a 100644 --- a/integration/molecule/default/destroy.yml +++ b/molecule_hetznercloud/playbooks/destroy.yml @@ -43,7 +43,7 @@ state: absent when: - not skip_instances - - instance_conf | length # must contain at least one instance + - instance_conf | length # must contain at least one instance - name: Populate instance config set_fact: diff --git a/molecule_hetznercloud/playbooks/prepare.yml b/molecule_hetznercloud/playbooks/prepare.yml new file mode 100644 index 0000000..ddb01fb --- /dev/null +++ b/molecule_hetznercloud/playbooks/prepare.yml @@ -0,0 +1,9 @@ +--- +- name: Prepare + hosts: all + gather_facts: false + tasks: + - name: Install python for Ansible + raw: test -e /usr/bin/python || (apt -y update && apt install -y python-minimal python-zipstream) + become: true + changed_when: false