Compare commits

...

42 Commits

Author SHA1 Message Date
Mike Holloway
16d5fe607d CI-CD debugging part I, see comment in diff 2025-01-06 19:57:29 -05:00
Mike Holloway
193c5485fe setup-opentofu action testing, part I 2025-01-06 19:49:35 -05:00
Mike Holloway
5bcc48a2b6 tofu instance import debug, vpc_subnet data parsing part II, (part I fb97fd0adf)
All checks were successful
Gitea Actions - molecule test work / Explore-terraform-molecule-Gitea-Action (push) Successful in 58s
2025-01-06 19:21:19 -05:00
Mike Holloway
fb97fd0adf tofu instance import debug, tofu state ls to investigate instance data parsing
All checks were successful
Gitea Actions - molecule test work / Explore-terraform-molecule-Gitea-Action (push) Successful in 56s
2025-01-06 19:02:50 -05:00
Mike Holloway
cb3017206b tofu instance import debug, tofu state show
All checks were successful
Gitea Actions - molecule test work / Explore-terraform-molecule-Gitea-Action (push) Successful in 57s
2025-01-06 18:48:42 -05:00
Mike Holloway
f8c1e31062 tofu instance data debug, tofu refresh, tofu show with chdir
All checks were successful
Gitea Actions - molecule test work / Explore-terraform-molecule-Gitea-Action (push) Successful in 59s
2025-01-06 18:44:12 -05:00
Mike Holloway
af9073354f tofu instance data debug, tofu refresh, tofu show
All checks were successful
Gitea Actions - molecule test work / Explore-terraform-molecule-Gitea-Action (push) Successful in 57s
2025-01-06 18:33:51 -05:00
Mike Holloway
604bbceaeb tofu instance data debug, tofu show, post-tofu state pull
All checks were successful
Gitea Actions - molecule test work / Explore-terraform-molecule-Gitea-Action (push) Successful in 55s
2025-01-06 18:31:51 -05:00
Mike Holloway
2a28432984 tofu instance data debug, correction - tofu state pull
All checks were successful
Gitea Actions - molecule test work / Explore-terraform-molecule-Gitea-Action (push) Successful in 57s
2025-01-06 18:28:05 -05:00
Mike Holloway
9c91ccca44 tofu instance data debug, tofu pull
Some checks failed
Gitea Actions - molecule test work / Explore-terraform-molecule-Gitea-Action (push) Failing after 54s
2025-01-06 18:26:10 -05:00
Mike Holloway
5f70f076cc tofu instance data debug, part II
All checks were successful
Gitea Actions - molecule test work / Explore-terraform-molecule-Gitea-Action (push) Successful in 54s
2025-01-06 18:23:57 -05:00
Mike Holloway
88f848cb20 tofu instance data debug, yaml format fix
All checks were successful
Gitea Actions - molecule test work / Explore-terraform-molecule-Gitea-Action (push) Successful in 55s
2025-01-06 18:21:06 -05:00
Mike Holloway
05751e3dbf tofu instance data debug
Some checks failed
Gitea Actions - molecule test work / Explore-terraform-molecule-Gitea-Action (push) Failing after 47s
2025-01-06 18:19:38 -05:00
Mike Holloway
f3306efb0f tofu import task cleanup
All checks were successful
Gitea Actions - molecule test work / Explore-terraform-molecule-Gitea-Action (push) Successful in 56s
2025-01-06 18:15:55 -05:00
Mike Holloway
f073fbd981 tofu import debug, quote enclusure for value pair expected by tofu import
Some checks failed
Gitea Actions - molecule test work / Explore-terraform-molecule-Gitea-Action (push) Failing after 52s
2025-01-06 18:12:18 -05:00
Mike Holloway
943553d4a6 tofu import debug
Some checks failed
Gitea Actions - molecule test work / Explore-terraform-molecule-Gitea-Action (push) Failing after 51s
2025-01-06 18:07:13 -05:00
Mike Holloway
188bf20236 gitea actions env: debug part V
All checks were successful
Gitea Actions - molecule test work / Explore-terraform-molecule-Gitea-Action (push) Successful in 55s
2025-01-06 17:59:26 -05:00
Mike Holloway
857fb87791 gitea actions env: debug part IV
Some checks failed
Gitea Actions - molecule test work / Explore-terraform-molecule-Gitea-Action (push) Failing after 49s
2025-01-06 17:57:50 -05:00
Mike Holloway
f019cf8c04 gitea actions env: debug part III
Some checks failed
Gitea Actions - molecule test work / Explore-terraform-molecule-Gitea-Action (push) Failing after 49s
2025-01-06 17:54:48 -05:00
Mike Holloway
eeea2d4485 gitea actions env: debug part II
Some checks failed
Gitea Actions - molecule test work / Explore-terraform-molecule-Gitea-Action (push) Failing after 50s
2025-01-06 17:52:11 -05:00
Mike Holloway
0c1d2a0de3 gitea actions env: debug
Some checks failed
Gitea Actions - molecule test work / Explore-terraform-molecule-Gitea-Action (push) Failing after 49s
2025-01-06 17:45:47 -05:00
Mike Holloway
ae0eb538e4 tofu project dir debug, TF_VAR testing
Some checks failed
Gitea Actions - molecule test work / Explore-terraform-molecule-Gitea-Action (push) Failing after 52s
2025-01-06 17:41:18 -05:00
Mike Holloway
d753983fb5 tofu project dir debug, tofu import
Some checks failed
Gitea Actions - molecule test work / Explore-terraform-molecule-Gitea-Action (push) Failing after 52s
2025-01-06 16:56:49 -05:00
Mike Holloway
17e4c288b8 tofu project dir debug, tofu init
All checks were successful
Gitea Actions - molecule test work / Explore-terraform-molecule-Gitea-Action (push) Successful in 53s
2025-01-06 16:38:50 -05:00
Mike Holloway
b1a396a3ba tofu project dir debug, $PWD, debug part VIII
Some checks failed
Gitea Actions - molecule test work / Explore-terraform-molecule-Gitea-Action (push) Failing after 49s
2025-01-06 16:04:41 -05:00
Mike Holloway
4e3f239259 tofu project dir debug, $PWD, debug part VII
All checks were successful
Gitea Actions - molecule test work / Explore-terraform-molecule-Gitea-Action (push) Successful in 51s
2025-01-06 16:02:32 -05:00
Mike Holloway
f5cd8f6491 tofu project dir debug, $PWD, debug part VI
All checks were successful
Gitea Actions - molecule test work / Explore-terraform-molecule-Gitea-Action (push) Successful in 50s
2025-01-06 15:59:50 -05:00
Mike Holloway
3dacc06c64 tofu project dir debug, $PWD, debug part V
Some checks failed
Gitea Actions - molecule test work / Explore-terraform-molecule-Gitea-Action (push) Failing after 47s
2025-01-06 15:57:21 -05:00
Mike Holloway
2572c7cb1a tofu project dir debug, $PWD, debug part IV
Some checks failed
Gitea Actions - molecule test work / Explore-terraform-molecule-Gitea-Action (push) Failing after 48s
2025-01-06 15:55:38 -05:00
Mike Holloway
6cbf0889d7 tofu project dir debug, $PWD, debug part III
Some checks failed
Gitea Actions - molecule test work / Explore-terraform-molecule-Gitea-Action (push) Failing after 50s
2025-01-06 07:17:33 -05:00
Mike Holloway
c29ad94601 tofu project dir debug, $PWD, debug part II
All checks were successful
Gitea Actions - molecule test work / Explore-terraform-molecule-Gitea-Action (push) Successful in 48s
2025-01-06 07:11:57 -05:00
Mike Holloway
756158ccdb tofu project dir debug, $PWD, debug
All checks were successful
Gitea Actions - molecule test work / Explore-terraform-molecule-Gitea-Action (push) Successful in 1m0s
2025-01-06 07:09:53 -05:00
Mike Holloway
248a5291b7 tofu project dir debug, $PWD
All checks were successful
Gitea Actions - molecule test work / Explore-terraform-molecule-Gitea-Action (push) Successful in 48s
2025-01-06 07:01:49 -05:00
Mike Holloway
01f16a40c4 tofu project dir debug, pwd
All checks were successful
Gitea Actions - molecule test work / Explore-terraform-molecule-Gitea-Action (push) Successful in 49s
2025-01-06 06:58:13 -05:00
Mike Holloway
e8d36340de tofu project dir debug
Some checks failed
Gitea Actions - molecule test work / Explore-terraform-molecule-Gitea-Action (push) Failing after 47s
2025-01-06 06:55:26 -05:00
Mike Holloway
f8696ae0c9 tofu import env vars part II
Some checks failed
Gitea Actions - molecule test work / Explore-terraform-molecule-Gitea-Action (push) Failing after 46s
2025-01-06 06:51:40 -05:00
Mike Holloway
9543799cc6 tofu import env vars
Some checks failed
Gitea Actions - molecule test work / Explore-terraform-molecule-Gitea-Action (push) Failing after 46s
2025-01-06 06:49:52 -05:00
Mike Holloway
003c6646d1 molecule test scenario flag
Some checks failed
Gitea Actions - molecule test work / Explore-terraform-molecule-Gitea-Action (push) Failing after 49s
2025-01-06 06:40:46 -05:00
Mike Holloway
ab623685fe ref correction
Some checks failed
Gitea Actions - molecule test work / Explore-terraform-molecule-Gitea-Action (push) Failing after 56s
2025-01-06 06:35:23 -05:00
Mike Holloway
1cdd3d4a9b Add .ssh/config mgmt step
Some checks failed
Gitea Actions - molecule test work / Explore-terraform-molecule-Gitea-Action (push) Failing after 1m6s
2025-01-06 06:31:30 -05:00
Mike Holloway
3bbfad68bd Update action conditions for demo.yml molecule scenario
Some checks failed
Gitea Actions - molecule test work / Explore-terraform-molecule-Gitea-Action (push) Failing after 1m0s
2025-01-06 06:25:01 -05:00
Mike Holloway
c8329a242b linode action yml test 2025-01-06 06:20:48 -05:00
6 changed files with 156 additions and 1 deletions

View File

@ -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:

View 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

View 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"

View 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"

View 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

View 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