This repository has been archived by the owner on Jan 8, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7 from bonddim/master
Updated plugin to use newer molecule APIs
- Loading branch information
Showing
4 changed files
with
102 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
--- | ||
- name: Create | ||
hosts: localhost | ||
connection: local | ||
gather_facts: false | ||
no_log: "{{ molecule_no_log }}" | ||
|
||
vars: | ||
default_source: | ||
type: image | ||
mode: pull | ||
server: https://images.linuxcontainers.org | ||
alias: ubuntu/bionic | ||
protocol: simplestreams | ||
default_config: | ||
"security.nesting": "true" | ||
|
||
tasks: | ||
- name: Create molecule instance(s) | ||
lxd_container: | ||
name: "{{ item.name }}" | ||
state: started | ||
source: "{{ default_source | combine(item.source | default({})) }}" | ||
config: "{{ default_config | combine(item.config | default({})) }}" | ||
architecture: "{{ item.architecture | default(omit) }}" | ||
devices: "{{ item.devices | default(omit) }}" | ||
profiles: "{{ item.profiles | default(omit) }}" | ||
url: "{{ item.url | default(omit) }}" | ||
cert_file: "{{ item.cert_file | default(omit) }}" | ||
key_file: "{{ item.key_file | default(omit) }}" | ||
trust_password: "{{ item.trust_password | default(omit) }}" | ||
wait_for_ipv4_addresses: true | ||
timeout: 600 | ||
loop: "{{ molecule_yml.platforms }}" | ||
loop_control: | ||
label: "{{ item.name }}" | ||
no_log: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
--- | ||
- name: Destroy | ||
hosts: localhost | ||
connection: local | ||
gather_facts: false | ||
no_log: "{{ molecule_no_log }}" | ||
|
||
tasks: | ||
- name: Destroy molecule instance(s) | ||
lxd_container: | ||
name: "{{ item.name }}" | ||
state: absent | ||
force_stop: "{{ item.force_stop | default(true) }}" | ||
url: "{{ item.url | default(omit) }}" | ||
cert_file: "{{ item.cert_file | default(omit) }}" | ||
key_file: "{{ item.key_file | default(omit) }}" | ||
trust_password: "{{ item.trust_password | default(omit) }}" | ||
loop: "{{ molecule_yml.platforms }}" | ||
loop_control: | ||
label: "{{ item.name }}" | ||
no_log: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
--- | ||
- name: Prepare | ||
hosts: all | ||
gather_facts: false | ||
no_log: "{{ molecule_no_log }}" | ||
|
||
tasks: | ||
- name: Install basic packages to bare containers | ||
tags: skip_ansible_lint | ||
raw: | | ||
if [ -x "$(command -v apt-get)" ]; then | ||
export DEBIAN_FRONTEND=noninteractive | ||
apt-get update --quiet && apt-get install --assume-yes --no-install-recommends ca-certificates curl python3 python3-apt | ||
elif [ -x "$(command -v dnf)" ]; then | ||
dnf --assumeyes install ca-certificates curl python3 python3-dnf | ||
elif [ -x "$(command -v yum)" ]; then | ||
yum install --assumeyes ca-certificates curl python | ||
elif [ -x "$(command -v zypper)" ]; then | ||
zypper --non-interactive --gpg-auto-import-keys refresh | ||
zypper --non-interactive install ca-certificates ca-certificates-cacert ca-certificates-mozilla curl python3 | ||
elif [ -x "$(command -v apk)" ]; then | ||
apk update && apk add ca-certificates curl python3 | ||
elif [ -x "$(command -v pacman)" ]; then | ||
pacman -Syu --noconfirm ca-certificates curl python3 | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters