7 Commits

Author SHA1 Message Date
67ca6b7a03 use real key
All checks were successful
continuous-integration/drone/push Build is passing
2022-05-31 08:18:35 +02:00
1077078de1 without list, load file straight in
Some checks failed
continuous-integration/drone/push Build is failing
2022-05-31 08:06:40 +02:00
c80bcb6439 fix syntax
Some checks failed
continuous-integration/drone/push Build is failing
2022-05-31 07:57:20 +02:00
06b1dd0d3d get docker going 2022-05-31 07:56:36 +02:00
e54b8fd503 fix typo
Some checks failed
continuous-integration/drone/push Build is failing
2022-05-31 07:46:55 +02:00
08f3d86a65 loading members the new way
Some checks failed
continuous-integration/drone/push Build is failing
2022-05-31 07:41:55 +02:00
d1a90a8910 cosmetic 2022-05-31 07:25:46 +02:00
7 changed files with 29 additions and 14 deletions

View File

@ -1,5 +1,5 @@
--- ---
skip_list: skip_list:
- fqcn-builtins - fqcn-builtins
- no-jinja-nesting
- experimental - experimental
- no-jinja-nesting

View File

@ -8,8 +8,12 @@ steps:
REMOTE_USER: molecule REMOTE_USER: molecule
HCLOUD_TOKEN: HCLOUD_TOKEN:
from_secret: HCLOUD_TOKEN from_secret: HCLOUD_TOKEN
volumes:
- name: docker_sock
path: /var/run/docker.sock
commands: commands:
- apt update && apt install -y pwgen - apt update && apt install -y pwgen curl
- curl -fsSL https://get.docker.com | bash
- mkdir -p /root/.ansible/roles && ln -sr . /root/.ansible/roles/autonomic.new-hetzner - mkdir -p /root/.ansible/roles && ln -sr . /root/.ansible/roles/autonomic.new-hetzner
- export INSTANCE_UUID=$(pwgen 8 1) - export INSTANCE_UUID=$(pwgen 8 1)
- pip install -r requirements.txt - pip install -r requirements.txt

View File

@ -2,12 +2,15 @@
- name: Converge - name: Converge
hosts: all hosts: all
vars: vars:
- new_hetzner_server_name: autonomic.new-hetzner-molecule new_hetzner_server_name: autonomic.new-hetzner-molecule
- add_users_inventory_hostname: autonomic.new-hetzner-molecule add_users_inventory_hostname: autonomic.new-hetzner-molecule
- new_hetzner_server_type: cx11 new_hetzner_server_type: cx11
- new_hetzner_server_image: debian-10 new_hetzner_server_image: debian-10
- new_hetzner_delete_protection: false new_hetzner_delete_protection: false
- new_hetzner_rebuild_protection: false new_hetzner_rebuild_protection: false
pre_tasks:
- name: Include resource variables
include_vars: files/members.yml
tasks: tasks:
- name: Run the role under test - name: Run the role under test
block: block:

View File

@ -0,0 +1,6 @@
---
members:
- username: foobar
email: barfoo
ssh_key: "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMniNzAzuI527bfk/EipqFILFayUCwYXDoZ3R7+QgYq6"
uid: 1100

View File

@ -1,5 +1,4 @@
--- ---
roles: roles:
- name: autonomic.add-users - name: autonomic.add-users
src: https://git.autonomic.zone/autonomic-cooperative/autonomic.add-users src: https://git.autonomic.zone/autonomic-cooperative/autonomic.add-users

View File

@ -1,5 +1,5 @@
ansible-lint==6.0.0 ansible-lint==6.0.0
ansible==5.4.0 ansible==5.4.0
molecule-docker=1.1.0 molecule-docker==1.1.0
molecule-hetznercloud==1.3.0 molecule-hetznercloud==1.3.0
molecule==3.6.1 molecule==3.6.1

View File

@ -4,14 +4,17 @@
that: "{{ item }} is defined" that: "{{ item }} is defined"
fail_msg: "You must define the '{{ item }}' variable" fail_msg: "You must define the '{{ item }}' variable"
with_items: with_items:
- members
- new_hetzner_server_image
- new_hetzner_server_name - new_hetzner_server_name
- new_hetzner_server_type - new_hetzner_server_type
- new_hetzner_server_image
- name: Include resource variables - name: Include resource variables
include_vars: "{{ role_path }}/../../resources/{{ lookup('env', 'MEMBERS_FILE') | default('members.yml', True) }}" include_vars: "{{ members }}"
tags:
- molecule-notest
# Note(decentral1se): gives root SSH access for all autonomic members # Note(decentral1se): gives root SSH access for all members
- name: Ensure all Autonomic member SSH keys are registered - name: Ensure all Autonomic member SSH keys are registered
hcloud_ssh_key: hcloud_ssh_key:
name: "{{ item.email }}" name: "{{ item.email }}"
@ -63,7 +66,7 @@
- name: Run the add-users role on the new instance - name: Run the add-users role on the new instance
vars: vars:
members: "../../../resources/members.yml" members: "{{ members }}"
delegate_to: root-new-instance delegate_to: root-new-instance
import_role: import_role:
name: autonomic.add-users name: autonomic.add-users