Compare commits
42 Commits
master
...
tofu-linod
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
16d5fe607d | ||
|
|
193c5485fe | ||
|
|
5bcc48a2b6 | ||
|
|
fb97fd0adf | ||
|
|
cb3017206b | ||
|
|
f8c1e31062 | ||
|
|
af9073354f | ||
|
|
604bbceaeb | ||
|
|
2a28432984 | ||
|
|
9c91ccca44 | ||
|
|
5f70f076cc | ||
|
|
88f848cb20 | ||
|
|
05751e3dbf | ||
|
|
f3306efb0f | ||
|
|
f073fbd981 | ||
|
|
943553d4a6 | ||
|
|
188bf20236 | ||
|
|
857fb87791 | ||
|
|
f019cf8c04 | ||
|
|
eeea2d4485 | ||
|
|
0c1d2a0de3 | ||
|
|
ae0eb538e4 | ||
|
|
d753983fb5 | ||
|
|
17e4c288b8 | ||
|
|
b1a396a3ba | ||
|
|
4e3f239259 | ||
|
|
f5cd8f6491 | ||
|
|
3dacc06c64 | ||
|
|
2572c7cb1a | ||
|
|
6cbf0889d7 | ||
|
|
c29ad94601 | ||
|
|
756158ccdb | ||
|
|
248a5291b7 | ||
|
|
01f16a40c4 | ||
|
|
e8d36340de | ||
|
|
f8696ae0c9 | ||
|
|
9543799cc6 | ||
|
|
003c6646d1 | ||
|
|
ab623685fe | ||
|
|
1cdd3d4a9b | ||
|
|
3bbfad68bd | ||
|
|
c8329a242b |
@ -1,6 +1,9 @@
|
||||
name: Gitea Actions - molecule test work
|
||||
run-name: ${{ gitea.actor }} is running molecule test work
|
||||
on: [push]
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- molecule-test
|
||||
|
||||
jobs:
|
||||
Explore-molecule-Gitea-Action:
|
||||
|
||||
56
.gitea/workflows/linode.yml
Normal file
56
.gitea/workflows/linode.yml
Normal file
@ -0,0 +1,56 @@
|
||||
name: Gitea Actions - molecule test work
|
||||
run-name: ${{ gitea.actor }} is running molecule test work
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- 'linode-test'
|
||||
|
||||
jobs:
|
||||
Explore-terraform-molecule-Gitea-Action:
|
||||
env:
|
||||
ANSIBLE_ROLES_PATH: '/workspace/seasharp/ansible-role_podman-host'
|
||||
TF_VAR_token: '3cc179bda24ac499f6d7ffbaa48d4a1def3f048483861d09d6cd9346e87e2b36'
|
||||
TF_VAR_root_pass: 'supersecretpassword'
|
||||
# ANSIBLE_REMOTE_TMP: '/root/.ansible/tmp/'
|
||||
# Add comment for CI debug
|
||||
EQIT_VPC: '136994'
|
||||
EQIT_VPC_SUBNET: '131754'
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: opentofu/setup-opentofu@v1
|
||||
run:
|
||||
working-directory: '${{ env.tf_actions_working_dir }}'
|
||||
# - name: Update ssh config
|
||||
# run: |
|
||||
# umask 077
|
||||
# mkdir .ssh
|
||||
# echo -e "Host git.libre.audio\n Port 2222" >> ~/.ssh/config
|
||||
# - name: tofu Checkout
|
||||
# uses: actions/checkout@v4
|
||||
# with:
|
||||
# repository: 'seasharp/eqit_tofu-plan'
|
||||
# ref: 'refs/heads/main'
|
||||
# path: 'tofu'
|
||||
# ssh-key: |-
|
||||
# -----BEGIN OPENSSH PRIVATE KEY-----
|
||||
# b3BlbnNzaC1rZXktdjEAAAAABG5vbmUAAAAEbm9uZQAAAAAAAAABAAAAMwAAAAtzc2gtZW
|
||||
# QyNTUxOQAAACCrwBEqzNuM0VFHpy9bBprXebPnu6oZFBfucpT1k3Bv8gAAAJh9CogdfQqI
|
||||
# HQAAAAtzc2gtZWQyNTUxOQAAACCrwBEqzNuM0VFHpy9bBprXebPnu6oZFBfucpT1k3Bv8g
|
||||
# AAAECnSrigm9ALsWTb6RnDhDFV/nViuPK1jzoE+FAmrwYfdavAESrM24zRUUenL1sGmtd5
|
||||
# s+e7qhkUF+5ylPWTcG/yAAAAEW0wMHRAbWlzZXJ2ZXIubGFuAQIDBA==
|
||||
# -----END OPENSSH PRIVATE KEY-----
|
||||
# ssh-known-hosts: |
|
||||
# git.libre.audio ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFLiDhNN7aPdGUt8gvvAftF5Oo3xwsy/JcT9gcX00BDW
|
||||
# [git.libre.audio]:2222 ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFLiDhNN7aPdGUt8gvvAftF5Oo3xwsy/JcT9gcX00BDW
|
||||
#
|
||||
# - name: Project Checkout
|
||||
# uses: actions/checkout@v4
|
||||
# with:
|
||||
# path: 'podman-host'
|
||||
# - name: Set up Python
|
||||
# uses: actions/setup-python@v2
|
||||
# - name: Molecule test
|
||||
# run: |
|
||||
# cd podman-host/extensions
|
||||
# molecule test -s linode
|
||||
8
extensions/molecule/linode/converge.yml
Normal file
8
extensions/molecule/linode/converge.yml
Normal file
@ -0,0 +1,8 @@
|
||||
---
|
||||
- name: Converge
|
||||
hosts: all
|
||||
gather_facts: false
|
||||
tasks:
|
||||
- name: Replace this task with one that validates your content
|
||||
ansible.builtin.debug:
|
||||
msg: "This is the effective test"
|
||||
56
extensions/molecule/linode/create.yml
Normal file
56
extensions/molecule/linode/create.yml
Normal file
@ -0,0 +1,56 @@
|
||||
---
|
||||
- name: Create
|
||||
hosts: localhost
|
||||
connection: local
|
||||
gather_facts: false
|
||||
# no_log: "{{ molecule_no_log }}"
|
||||
tasks:
|
||||
# TODO: Developer must implement and populate 'server' variable
|
||||
- name: Import state into tofu
|
||||
command:
|
||||
cmd: |
|
||||
{{ item }}
|
||||
chdir: "/workspace/seasharp/ansible-role_podman-host/tofu"
|
||||
loop:
|
||||
- tofu init
|
||||
- tofu import module.main_vpc_subnet.linode_vpc.eqit_vpc {{ lookup('env', 'EQIT_VPC') }}
|
||||
- tofu import module.main_vpc_subnet.linode_vpc_subnet.eqit_vpc_subnet "{{ lookup('env', 'EQIT_VPC') }}, {{ lookup('env', 'EQIT_VPC_SUBNET') }}"
|
||||
- tofu refresh
|
||||
|
||||
- name: Tofu show
|
||||
command:
|
||||
cmd: |
|
||||
tofu state ls
|
||||
chdir: "/workspace/seasharp/ansible-role_podman-host/tofu"
|
||||
register: mycmd
|
||||
## grep names from subnet data
|
||||
## tofu import module.instance
|
||||
- debug:
|
||||
msg: |
|
||||
{{ mycmd.stdout_lines }}
|
||||
# - name: Create instance config
|
||||
# when: server.changed | default(false) | bool # noqa no-handler
|
||||
# block:
|
||||
# - name: Populate instance config dict # noqa jinja
|
||||
# ansible.builtin.set_fact:
|
||||
# instance_conf_dict: {}
|
||||
# # instance': "{{ }}",
|
||||
# # address': "{{ }}",
|
||||
# # user': "{{ }}",
|
||||
# # port': "{{ }}",
|
||||
# # 'identity_file': "{{ }}", }
|
||||
# with_items: "{{ server.results }}"
|
||||
# register: instance_config_dict
|
||||
#
|
||||
# - name: Convert instance config dict to a list
|
||||
# ansible.builtin.set_fact:
|
||||
# instance_conf: "{{ instance_config_dict.results | map(attribute='ansible_facts.instance_conf_dict') | list }}"
|
||||
#
|
||||
# - name: Dump instance config
|
||||
# ansible.builtin.copy:
|
||||
# content: |
|
||||
# # Molecule managed
|
||||
#
|
||||
# {{ instance_conf | to_json | from_json | to_yaml }}
|
||||
# dest: "{{ molecule_instance_config }}"
|
||||
# mode: "0600"
|
||||
24
extensions/molecule/linode/destroy.yml
Normal file
24
extensions/molecule/linode/destroy.yml
Normal file
@ -0,0 +1,24 @@
|
||||
---
|
||||
- name: Destroy
|
||||
hosts: localhost
|
||||
connection: local
|
||||
gather_facts: false
|
||||
# no_log: "{{ molecule_no_log }}"
|
||||
tasks:
|
||||
# Developer must implement.
|
||||
|
||||
# Mandatory configuration for Molecule to function.
|
||||
|
||||
- name: Populate instance config
|
||||
ansible.builtin.set_fact:
|
||||
instance_conf: {}
|
||||
|
||||
- name: Dump instance config
|
||||
ansible.builtin.copy:
|
||||
content: |
|
||||
# Molecule managed
|
||||
|
||||
{{ instance_conf | to_json | from_json | to_yaml }}
|
||||
dest: "{{ molecule_instance_config }}"
|
||||
mode: "0600"
|
||||
when: server.changed | default(false) | bool # noqa no-handler
|
||||
8
extensions/molecule/linode/molecule.yml
Normal file
8
extensions/molecule/linode/molecule.yml
Normal file
@ -0,0 +1,8 @@
|
||||
---
|
||||
driver:
|
||||
name: default
|
||||
platforms:
|
||||
- name: instance
|
||||
# you might want to add your own variables here based on what provisioning
|
||||
# you are doing like:
|
||||
# image: quay.io/centos/centos:stream8
|
||||
Loading…
Reference in New Issue
Block a user