Author SHA1 Message Date
Mike Holloway 77bbbc8ffb Revert "tags: - 'molecule-notest'"
Gitea Actions - molecule test work / Explore-terraform-molecule-Gitea-Action (push) Successful in 7m36s
Gitea Actions - molecule test work / Explore-molecule-Gitea-Action (push) Successful in 2m59s
Reason:

  Running on linode instances, /etc/hosts file changes are worth
testing.

This reverts commit f51c228573.
2025-01-07 20:46:57 -05:00
Mike Holloway 7d46ec7d7d requirements.yml
Gitea Actions - molecule test work / Explore-terraform-molecule-Gitea-Action (push) Successful in 7m15s
2025-01-07 20:33:26 -05:00
Mike Holloway af221cb741 Use linode hosts
Gitea Actions - molecule test work / Explore-terraform-molecule-Gitea-Action (push) Successful in 5m26s
2025-01-07 20:27:19 -05:00
Mike Holloway a49e672ec0 First draft linode scenario converge, destroy steps
Gitea Actions - molecule test work / Explore-terraform-molecule-Gitea-Action (push) Successful in 5m31s
2025-01-07 20:12:07 -05:00
Mike Holloway 336d673393 gitea actions tofu authorized_keys, inventory_hostname
Gitea Actions - molecule test work / Explore-terraform-molecule-Gitea-Action (push) Successful in 5m28s
2025-01-07 19:54:39 -05:00
Mike Holloway 23bee6e6f9 ansible ssh debug, ssh config usage, copy step added
Gitea Actions - molecule test work / Explore-terraform-molecule-Gitea-Action (push) Successful in 7m4s
2025-01-07 19:34:57 -05:00
Mike Holloway a12732a7b9 ansible ssh debug, copy step for private key, verbose ssh connection check
Gitea Actions - molecule test work / Explore-terraform-molecule-Gitea-Action (push) Successful in 6m52s
2025-01-07 19:22:15 -05:00
Mike Holloway 08ea840c99 ansible ssh debug, checking accept-new option for pre-inventory reachability test, printing full isping object
Gitea Actions - molecule test work / Explore-terraform-molecule-Gitea-Action (push) Successful in 4m59s
2025-01-07 19:12:16 -05:00
Mike Holloway 4430880f8f Private key check using HOME env var, reach test output cleanup
Gitea Actions - molecule test work / Explore-terraform-molecule-Gitea-Action (push) Successful in 4m52s
2025-01-07 19:00:25 -05:00
Mike Holloway 5ebaffdba2 Correct private key path, linode hosts ansible_user set
Gitea Actions - molecule test work / Explore-terraform-molecule-Gitea-Action (push) Successful in 5m2s
2025-01-07 18:49:36 -05:00
Mike Holloway cc7db336bb Quotes around interpolated gitea actions secret as exported env var in run: step
Gitea Actions - molecule test work / Explore-terraform-molecule-Gitea-Action (push) Successful in 4m53s
2025-01-07 18:38:37 -05:00
Mike Holloway 9dad63a0e0 Deploy Key gitea actions secret
Gitea Actions - molecule test work / Explore-terraform-molecule-Gitea-Action (push) Successful in 4m51s
2025-01-07 18:12:38 -05:00
Mike Holloway 19dc7cb495 Host key checking workaround check
Gitea Actions - molecule test work / Explore-terraform-molecule-Gitea-Action (push) Successful in 7m1s
2025-01-07 07:13:09 -05:00
Mike Holloway 1ba3039f28 More retries, longer delay
Gitea Actions - molecule test work / Explore-terraform-molecule-Gitea-Action (push) Successful in 7m4s
2025-01-07 07:04:48 -05:00
Mike Holloway 2522389d35 ssh -T step retries
Gitea Actions - molecule test work / Explore-terraform-molecule-Gitea-Action (push) Successful in 5m17s
2025-01-07 07:00:01 -05:00
Mike Holloway 664b12e508 continue-on-error: for good vps hygiene, 5m timeout for ssh connection test
Gitea Actions - molecule test work / Explore-terraform-molecule-Gitea-Action (push) Successful in 5m0s
2025-01-07 06:49:36 -05:00
Mike Holloway e03e08f81d ping missing, ssh -T instead
Gitea Actions - molecule test work / Explore-terraform-molecule-Gitea-Action (push) Failing after 1m27s
2025-01-07 06:43:24 -05:00
Mike Holloway 5c75f85d9d tofu and molecule combined test, correct scenario flag, correct ANSIBLE_ROLES_PATH env var
Gitea Actions - molecule test work / Explore-terraform-molecule-Gitea-Action (push) Failing after 1m26s
2025-01-07 06:38:14 -05:00
Mike Holloway a895093720 tofu and molecule combined test, with correct path for checkout and adjusted working-directory, python step
Gitea Actions - molecule test work / Explore-terraform-molecule-Gitea-Action (push) Failing after 2m14s
2025-01-07 06:32:26 -05:00
Mike Holloway c1373fdeb4 tofu and molecule combined test, with correct path for checkout and adjusted working-directory
Gitea Actions - molecule test work / Explore-terraform-molecule-Gitea-Action (push) Failing after 1m17s
2025-01-07 06:23:28 -05:00
Mike Holloway de2125deab tofu and molecule combined test, with correct path for checkout
Gitea Actions - molecule test work / Explore-terraform-molecule-Gitea-Action (push) Failing after 25s
2025-01-07 06:21:53 -05:00
Mike Holloway 189e33d9f4 tofu and molecule combined test, first try
Gitea Actions - molecule test work / Explore-terraform-molecule-Gitea-Action (push) Failing after 1m15s
2025-01-07 06:18:10 -05:00
Mike Holloway 5cbd574a02 tofu plan, tofu output json capture and export test part VII
Gitea Actions - molecule test work / Explore-terraform-molecule-Gitea-Action (push) Successful in 7m2s
2025-01-07 05:15:27 -05:00
Mike Holloway ad2646c7b8 tofu plan, tofu output json capture and export test part VI
Gitea Actions - molecule test work / Explore-terraform-molecule-Gitea-Action (push) Successful in 7m3s
2025-01-07 05:11:12 -05:00
Mike Holloway 09e9529e77 tofu plan, tofu output json capture and export test part V
Gitea Actions - molecule test work / Explore-terraform-molecule-Gitea-Action (push) Failing after 1m40s
2025-01-07 04:58:59 -05:00
Mike Holloway 3dc23d3548 tofu plan, tofu output json capture and export test part IV
Gitea Actions - molecule test work / Explore-terraform-molecule-Gitea-Action (push) Failing after 33s
2025-01-07 04:56:32 -05:00
Mike Holloway 3b9d996c50 tofu plan, tofu output json capture and export test part III 2025-01-07 04:55:08 -05:00
Mike Holloway 382ef9743e tofu plan, tofu output json capture and export test part II 2025-01-07 04:50:53 -05:00
Mike Holloway 21bbb23545 tofu plan, tofu output json capture and export test 2025-01-07 04:44:06 -05:00
Mike Holloway 34aae1b35e tofu plan, tofu output test
Gitea Actions - molecule test work / Explore-terraform-molecule-Gitea-Action (push) Successful in 34s
2025-01-07 04:33:58 -05:00
Mike Holloway 65d43e1da8 tofu apply && sleep 300 && tofu destroy
Gitea Actions - molecule test work / Explore-terraform-molecule-Gitea-Action (push) Successful in 7m22s
2025-01-07 04:20:54 -05:00
Mike Holloway 587eeb8ca0 tofu plan
Gitea Actions - molecule test work / Explore-terraform-molecule-Gitea-Action (push) Successful in 30s
2025-01-07 04:18:23 -05:00
Mike Holloway 381de46f2e tofu syntax check
Gitea Actions - molecule test work / Explore-terraform-molecule-Gitea-Action (push) Successful in 31s
2025-01-07 04:16:17 -05:00
Mike Holloway 27882fbfe2 tofu init test part X
Gitea Actions - molecule test work / Explore-terraform-molecule-Gitea-Action (push) Failing after 28s
2025-01-07 04:14:22 -05:00
Mike Holloway 1fcc4a574e tofu init test part IX
Gitea Actions - molecule test work / Explore-terraform-molecule-Gitea-Action (push) Successful in 29s
2025-01-07 04:12:40 -05:00
Mike Holloway 2b0f2ad0b7 tofu init test part VIII
Gitea Actions - molecule test work / Explore-terraform-molecule-Gitea-Action (push) Failing after 28s
2025-01-07 04:10:51 -05:00
Mike Holloway 9246eab0cb tofu init test part VII
Gitea Actions - molecule test work / Explore-terraform-molecule-Gitea-Action (push) Failing after 30s
2025-01-07 04:09:17 -05:00
Mike Holloway 6812e50ffe tofu init test part VI
Gitea Actions - molecule test work / Explore-terraform-molecule-Gitea-Action (push) Successful in 27s
2025-01-07 04:08:04 -05:00
Mike Holloway 31a60ec91e tofu init test part V
Gitea Actions - molecule test work / Explore-terraform-molecule-Gitea-Action (push) Successful in 30s
2025-01-07 04:06:55 -05:00
Mike Holloway 64de163949 tofu init test part IV
Gitea Actions - molecule test work / Explore-terraform-molecule-Gitea-Action (push) Successful in 30s
2025-01-07 04:05:50 -05:00
Mike Holloway 6f99869aee tofu init test part III
Gitea Actions - molecule test work / Explore-terraform-molecule-Gitea-Action (push) Successful in 28s
2025-01-07 04:03:56 -05:00
Mike Holloway fd652f20e1 tofu init test part II
Gitea Actions - molecule test work / Explore-terraform-molecule-Gitea-Action (push) Successful in 31s
2025-01-07 04:02:06 -05:00
Mike Holloway d6f7354060 tofu init test
Gitea Actions - molecule test work / Explore-terraform-molecule-Gitea-Action (push) Successful in 25s
2025-01-07 03:57:10 -05:00
Mike Holloway 09fa4da80d Add basic tofu workflow, debug gitea act secrets in env part III
Gitea Actions - molecule test work / Explore-terraform-molecule-Gitea-Action (push) Successful in 24s
2025-01-07 03:52:51 -05:00
Mike Holloway 901b0d4aa4 Add basic tofu workflow, debug gitea act secrets in env part II
Gitea Actions - molecule test work / Explore-terraform-molecule-Gitea-Action (push) Successful in 26s
2025-01-07 03:50:08 -05:00
Mike Holloway ac0c9ac39c Add basic tofu workflow, debug gitea act secrets in env
Gitea Actions - molecule test work / Explore-terraform-molecule-Gitea-Action (push) Failing after 0s
2025-01-07 03:47:07 -05:00
Mike Holloway e4abdeb926 Merge tag 'molecule-test' 2025-01-07 03:16:08 -05:00
Mike Holloway 23310cea5b Merge commit '48c4a09d5d'
Gitea Actions - molecule test work / Explore-molecule-Gitea-Action (push) Successful in 2m50s
2025-01-07 03:12:36 -05:00
Mike Holloway 3fb4b124a1 Distinguish build tag for molecule
Gitea Actions - molecule test work / Explore-molecule-Gitea-Action (push) Successful in 3m7s
Gitea Actions - molecule test work / Explore-terraform-molecule-Gitea-Action (push) Successful in 23s
2025-01-07 02:58:01 -05:00
Mike Holloway 48c4a09d5d Simple single-target tofu build is the goal
Gitea Actions - molecule test work / Explore-molecule-Gitea-Action (push) Successful in 2m52s
Gitea Actions - molecule test work / Explore-terraform-molecule-Gitea-Action (push) Successful in 22s
2025-01-07 02:52:01 -05:00
Mike Holloway b2b2c319bb Simple single-target tofu build is the goal
Gitea Actions - molecule test work / Explore-molecule-Gitea-Action (push) Successful in 2m56s
2025-01-07 02:34:38 -05:00
8 changed files with 188 additions and 114 deletions

No files matched your search

+28
View File
@@ -0,0 +1,28 @@
terraform {
required_providers {
linode = {
source = "linode/linode"
# version = "..."
}
}
}
# Configure the Linode Provider
provider "linode" {
token = var.token
}
resource "linode_instance" "eqit_test_instance" {
image = "linode/almalinux9"
label = "act_worker"
region = "us-ord"
type = "g6-nanode-1"
authorized_keys = ["ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCeRI1w3uNny7KjK2UdlAnyoGdGgtOx4isSD52u5dr4QkkdLRMj42dLjgT0MK+QehlgaH2XzFPMDz+hZQ+66YeBSm+F4km/8F9XVyUzGl0scUA1p0pqeL3FiyM3Art4Bo71zuE3PvMjyI3pGMKQ3VDWVA0XdAjjSw4G+czJTxZLLBPGvzDT07WuWM4Evl6H21Gn7PB6CKNV0vuUZwGiCsjRbghml1L2kDtTXV1B6wQsniuhQigIVo6YXhMgge/2UCcmiyeEizdfaSstrQHEyxFMvlPUJyw4a3plAuPORDyZdAFF6OA7/wP5fVWoCu/CkbMIDjPifXGQOuhQU1qUVy7r m00t@miserver.lan","ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINi1TmECeYdnrw8OCiBVB+rm8SwBWcz98Se/q+3l3iM/ act_runner@miserver.lan"]
root_pass = "supersecrettestpassword"
}
variable "token" {}
output "act_worker_ip_address" {
value = linode_instance.eqit_test_instance.ip_address
}
+2 -2
View File
@@ -2,8 +2,8 @@ name: Gitea Actions - molecule test work
run-name: ${{ gitea.actor }} is running molecule test work
on:
push:
branches:
- molecule-test
tags:
- 'molecule-test'
jobs:
Explore-molecule-Gitea-Action:
+21 -41
View File
@@ -9,48 +9,28 @@ 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'
TF_VAR_token: "${{ secrets.LINODE_API_TOKEN }}"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
path: 'podman-host'
- 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
- name: tofu apply
run: "tofu init && tofu apply -auto-approve"
working-directory: "${{ gitea.workspace }}/podman-host/.gitea/tofu"
- name: Set up Python
uses: actions/setup-python@v2
- name: molecule test
continue-on-error: true
run: |
export TARGET_IP_ADDRESS=$(tofu output -raw act_worker_ip_address)
export ACT_RUNNER_DEPLOY_KEY="${{ secrets.ACT_RUNNER_DEPLOY_KEY }}"
cd ${{ gitea.workspace}}/podman-host/extensions
molecule test -s linode
working-directory: "${{ gitea.workspace }}/podman-host/.gitea/tofu"
- name: tofu destroy
run: "sleep 180 && tofu destroy -auto-approve"
working-directory: "${{ gitea.workspace }}/podman-host/.gitea/tofu"
+23 -5
View File
@@ -1,8 +1,26 @@
---
- name: Converge
hosts: all
gather_facts: false
- name: Fail if linode group is missing
hosts: localhost
tasks:
- name: Replace this task with one that validates your content
- name: Print some info
ansible.builtin.debug:
msg: "This is the effective test"
msg: "{{ groups }}"
- name: Assert group existence
ansible.builtin.assert:
that: "'linode' in groups"
fail_msg: |
linode group was not found inside inventory groups: {{ groups }}
- name: Converge
hosts: linode
# We disable gather facts because it would fail due to our container not
# having python installed. This will not prevent use from running 'raw'
# commands. Most molecule users are expected to use containers that already
# have python installed in order to avoid notable delays installing it.
tasks:
- name: Apply podman-host Role
include_role:
name: podman-host
# ansible.builtin.assert:
# that: result.stdout | regex_search("^Linux")
+102 -45
View File
@@ -4,53 +4,110 @@
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
vars:
molecule_inventory:
all:
hosts: {}
linode: {}
- name: Tofu show
tasks:
- name: ssh key setup
copy:
content: |
{{ lookup('env', 'ACT_RUNNER_DEPLOY_KEY') }}
dest: "~/.ssh/id_ed25519"
- name: ssh config setup
copy:
content: |
Host act_worker
Hostname {{ lookup('env', 'TARGET_IP_ADDRESS') }}
StrictHostKeyChecking accept-new
User root
IdentityFile ~/.ssh/id_ed25519
dest: "~/.ssh/config"
- name: Confirm we can reach
command:
cmd: |
tofu state ls
chdir: "/workspace/seasharp/ansible-role_podman-host/tofu"
register: mycmd
## grep names from subnet data
## tofu import module.instance
ssh -vv -T act_worker
retries: 12
delay: 10
register: isping
until: isping.rc == 0
- 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"
{{ isping }}
- name: Fail if instance is not running
when: isping.failed
fail:
- name: Add linode to molecule_inventory
vars:
inventory_partial_yaml: |
all:
children:
linode:
hosts:
act_worker:
ansible_connection: ssh
service_users:
- name: serviceuser1
services:
- service1
- service2
ansible.builtin.set_fact:
molecule_inventory: >
{{ molecule_inventory | combine(inventory_partial_yaml | from_yaml, recursive=true) }}
- name: Dump molecule_inventory
ansible.builtin.copy:
content: |
{{ molecule_inventory | to_yaml }}
dest: "{{ molecule_ephemeral_directory }}/inventory/molecule_inventory.yml"
mode: "0600"
- name: Force inventory refresh
ansible.builtin.meta: refresh_inventory
- name: Fail if linode group is missing
ansible.builtin.assert:
that: "'linode' in groups"
fail_msg: |
linode group was not found inside inventory groups: {{ groups }}
run_once: true # noqa: run-once[task]
# we want to avoid errors like "Failed to create temporary directory"
- name: Validate that inventory was refreshed
hosts: linode
gather_facts: false
tasks:
- name: Check uname
ansible.builtin.raw: uname -a
register: result
changed_when: false
- name: Display uname info
ansible.builtin.debug:
msg: "{{ result.stdout }}"
- name: Verify linode properties
hosts: linode
gather_facts: false
tasks:
- name: Packages openssh-server, python3-policycoreutils
ansible.builtin.dnf:
name: ['openssh-server', 'python3-policycoreutils']
state: present
- name: systemd PID
command: ps -q 1
register: ps_result
changed_when: false
- name: Display PID 1 info
ansible.builtin.debug:
msg: "{{ ps_result.stdout }}"
+8 -17
View File
@@ -5,20 +5,11 @@
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
- name: Remove dynamic molecule inventory
hosts: localhost
gather_facts: false
tasks:
- name: Remove dynamic inventory file
ansible.builtin.file:
path: "{{ molecule_ephemeral_directory }}/inventory/molecule_inventory.yml"
state: absent # Developer must implement.
@@ -0,0 +1,2 @@
collections:
- community.general
+2 -4
View File
@@ -101,8 +101,7 @@
owner: root
group: root
mode: 0644
tags:
- 'molecule-notest'
when: '"molecule" not in group_names'
- lineinfile:
path: /etc/hosts
@@ -111,8 +110,7 @@
owner: root
group: root
mode: 0644
tags:
- 'molecule-notest'
when: '"molecule" not in group_names'
# - name: Copy cni networking driver config into place
# blockinfile:
# name: "/etc/cni/net.d/podman.conflist"