init dev env with molecule

This commit is contained in:
vincent 2022-10-30 18:18:58 +01:00
parent 4b2fc3b11d
commit d65eb1a6f3
8 changed files with 107 additions and 9 deletions

View File

@ -10,3 +10,10 @@ deploy_staging:
generate-token: generate-token:
@echo export VAULT_TOKEN=`vault token create -policy=ansible -field="token" -period 6h` @echo export VAULT_TOKEN=`vault token create -policy=ansible -field="token" -period 6h`
create-dev:
molecule converge
destroy-dev:
molecule destroy

View File

@ -0,0 +1,15 @@
***********************************
Delegated driver installation guide
***********************************
Requirements
============
This driver is delegated to the developer. Up to the developer to implement
requirements.
Install
=======
This driver is delegated to the developer. Up to the developer to implement
requirements.

View File

@ -0,0 +1,2 @@
---
- import_playbook: ../../site.yml

View File

@ -0,0 +1,45 @@
---
dependency:
name: galaxy
driver:
name: lxd
platforms:
- name: oscar-dev
image: images:archlinux
source:
type: image
mode: pull
alias: archlinux
- name: merlin-dev
source:
type: image
mode: pull
alias: rockylinux/9
- name: gerard-dev
source:
type: image
mode: pull
alias: debian/11
provisioner:
name: ansible
connection_options:
ansible_ssh_user: user
ansible_become: true
log: true
lint:
name: ansible-lint
inventory:
host_vars:
oscar-dev:
user:
name: user
merlin-dev:
user:
name: user
gerard-dev:
user:
name: user
links:
hosts: ../../staging
verifier:
name: ansible

View File

@ -0,0 +1,9 @@
- hosts: all
remote_user: root
become: true
gather_facts: false
tasks:
- name: Init pacman
ansible.builtin.include_role:
name: ansible_bootstrap

View File

@ -0,0 +1,10 @@
---
# This is an example playbook to execute Ansible tests.
- name: Verify
hosts: all
gather_facts: false
tasks:
- name: Example assertion
ansible.builtin.assert:
that: true

View File

@ -1,13 +1,15 @@
[homelab]
oscar-dev
gerard-dev
[VPS] [VPS]
VMDR merlin-dev
[dhcp]
VMAS-BUILD
[VMServer]
VMAS-HML
[wireguard] [wireguard]
VMDR oscar-dev
gerard-dev
[database]
oscar-dev

View File

@ -9,3 +9,11 @@ vault-dev:
else \ else \
./vault/standalone_vault.sh $(FILE);\ ./vault/standalone_vault.sh $(FILE);\
fi fi
create-dev:
make -C ansible create-dev
destroy-dev:
make -C ansible destroy-dev