Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/generate ansible inv pre task #435

Merged
merged 3 commits into from
Jan 13, 2025
Merged

Conversation

bancey
Copy link
Owner

@bancey bancey commented Jan 13, 2025

No description provided.

@autonomous-bancey
Copy link
Contributor

Plan Result (generate_ansible_inventory)

No changes. Your infrastructure matches the configuration.

@autonomous-bancey
Copy link
Contributor

Plan Result (test_vpn_gateway)

No changes. Your infrastructure matches the configuration.

@autonomous-bancey
Copy link
Contributor

Plan Result (prod_twingate)

No changes. Your infrastructure matches the configuration.

@autonomous-bancey
Copy link
Contributor

Plan Result (prod_vpn_gateway)

No changes. Your infrastructure matches the configuration.

@autonomous-bancey
Copy link
Contributor

Plan Result (test_gameserver)

No changes. Your infrastructure matches the configuration.

@autonomous-bancey
Copy link
Contributor

Plan Result (prod_gameserver)

No changes. Your infrastructure matches the configuration.

@autonomous-bancey
Copy link
Contributor

Plan Result (tiny_virtual_machines)

⚠️ Resource Deletion will happen

This plan contains resource delete operation. Please check the plan result very carefully!

Plan: 4 to add, 0 to change, 4 to destroy.
  • Replace
    • proxmox_virtual_environment_download_file.tiny_images["hela-jammy-server-cloudimg-amd64.img"]
    • proxmox_virtual_environment_download_file.tiny_images["loki-jammy-server-cloudimg-amd64.img"]
    • proxmox_virtual_environment_download_file.tiny_images["thor-jammy-server-cloudimg-amd64.img"]
    • terraform_data.k8s_ansible["tiny"]
Change Result (Click me)
  # proxmox_virtual_environment_download_file.tiny_images["hela-jammy-server-cloudimg-amd64.img"] must be replaced
-/+ resource "proxmox_virtual_environment_download_file" "tiny_images" {
      ~ id                  = "local:iso/jammy-server-cloudimg-amd64.img" -> (known after apply)
      ~ size                = 666228224 -> (known after apply) # forces replacement
        # (9 unchanged attributes hidden)
    }

  # proxmox_virtual_environment_download_file.tiny_images["loki-jammy-server-cloudimg-amd64.img"] must be replaced
-/+ resource "proxmox_virtual_environment_download_file" "tiny_images" {
      ~ id                  = "local:iso/jammy-server-cloudimg-amd64.img" -> (known after apply)
      ~ size                = 666228224 -> (known after apply) # forces replacement
        # (9 unchanged attributes hidden)
    }

  # proxmox_virtual_environment_download_file.tiny_images["thor-jammy-server-cloudimg-amd64.img"] must be replaced
-/+ resource "proxmox_virtual_environment_download_file" "tiny_images" {
      ~ id                  = "local:iso/jammy-server-cloudimg-amd64.img" -> (known after apply)
      ~ size                = 666228224 -> (known after apply) # forces replacement
        # (9 unchanged attributes hidden)
    }

  # terraform_data.k8s_ansible["tiny"] must be replaced
-/+ resource "terraform_data" "k8s_ansible" {
      ~ id               = "11e43c96-cd0d-780f-36ba-6cf419676243" -> (known after apply)
      ~ triggers_replace = [
            # (2 unchanged elements hidden)
            {
                hela-tiny-master0 = {
                    primary_mac_address = "BC:24:11:22:1C:50"
                }
                hela-tiny-node0   = {
                    primary_mac_address = "BC:24:11:91:B7:DC"
                }
                loki-tiny-master1 = {
                    primary_mac_address = "BC:24:11:22:E4:A3"
                }
                loki-tiny-node1   = {
                    primary_mac_address = "BC:24:11:DE:E9:1B"
                }
                thor-tiny-master2 = {
                    primary_mac_address = "BC:24:11:8D:F5:D1"
                }
                thor-tiny-node2   = {
                    primary_mac_address = "BC:24:11:90:65:2A"
                }
            },
          ~ <<-EOT
                - name: Prepare and install K3S
                  vars:
                    passed_hosts: wanda_k3s_cluster
              -     k3s_version: "v1.31.4+k3s1"
              +     k3s_version: "v1.32.0+k3s1"
                    run_prep: true
                    run_install: false
                  hosts: "{{ passed_hosts }}"
                  become: true
                  become_user: root
                  become_method: sudo
                  pre_tasks:
                    - name: Set master nodes to be a control node
                      ansible.builtin.set_fact:
                        k3s_control_node: true
                      when: "'master' in inventory_hostname"
                    - name: Add node-ip to k3s_server conf
                      ansible.builtin.set_fact:
                        k3s_server: "{{ k3s_server | combine({ 'node-ip': ansible_host}) }}"
                  tasks:
                    - name: K3S Prepare
                      when: run_prep
                      ansible.builtin.include_role:
                        name: prep
                    - name: Install K3S
                      when: run_install
                      ansible.builtin.include_role:
                        name: xanmanning.k3s
                        public: true
                      vars:
                        k3s_release_version: "{{ k3s_version }}"
                        k3s_install_hard_links: true
                        k3s_become: true
                        k3s_server_manifests_urls:
                          - url: https://raw.githubusercontent.com/projectcalico/calico/v3.29.1/manifests/tigera-operator.yaml
                            filename: tigera-operator.yaml
                          - url: https://raw.githubusercontent.com/metallb/metallb/v0.14.9/config/manifests/metallb-native.yaml
                            filename: metallb-native.yaml
                        k3s_server_manifests_templates:
                          - calico-install.yaml.j2
                          - metallb-config.yaml.j2
                          - coredns-custom.yaml
                    - name: Resource Readiness Check
                      run_once: true
                      kubernetes.core.k8s_info:
                        kubeconfig: /etc/rancher/k3s/k3s.yaml
                        kind: "{{ item.kind }}"
                        name: "{{ item.name }}"
                        namespace: "{{ item.namespace | default('') }}"
                        wait: true
                        wait_sleep: 10
                        wait_timeout: 360
                      loop:
                        - kind: Deployment
                          name: tigera-operator
                          namespace: tigera-operator
                        - kind: Installation
                          name: default
                        - kind: IPAddressPool
                          name: default
                          namespace: metallb-system
                        - kind: L2Advertisement
                          name: default
                          namespace: metallb-system
                      register: resource_check
                      when:
                        - k3s_server_manifests_templates | length > 0
                            or k3s_server_manifests_urls | length > 0
                        - k3s_control_node is defined
                        - k3s_control_node
                    - name: Remove deployed manifest templates
                      ansible.builtin.file:
                        path: "{{ k3s_server_manifests_dir }}/{{ item | basename |
                          regex_replace('\\.j2$', '') }}"
                        state: absent
                      loop: "{{ k3s_server_manifests_templates | default([]) }}"
                    - name: Remove deployed manifest urls
                      ansible.builtin.file:
                        path: "{{ k3s_server_manifests_dir }}/{{ item.filename }}"
                        state: absent
                      loop: "{{ k3s_server_manifests_urls | default([]) }}"
            EOT,
        ]
    }

Plan: 4 to add, 0 to change, 4 to destroy.

@autonomous-bancey
Copy link
Contributor

Plan Result (prod_dns)

No changes. Your infrastructure matches the configuration.

Copy link

@mergify mergify bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 LGTM! beep boop

@bancey bancey merged commit 93a5fd9 into main Jan 13, 2025
14 checks passed
@bancey bancey deleted the fix/generate-ansible-inv-pre-task branch January 16, 2025 16:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant