Skip to content
This repository has been archived by the owner on Apr 30, 2024. It is now read-only.

Route53 #20

Open
wants to merge 16 commits into
base: master
Choose a base branch
from
70 changes: 70 additions & 0 deletions add_route53_A_record.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# Add new.foo.com as an A record with 3 IPs and wait until the changes have been replicated
---
- name: Add a new AWS route53 DNS A record
hosts: all
# gather_facts: no
# connection: local

tasks:
- name: Basic env usage
debug:
msg: "'{{ lookup('env', 'AWX_HOST') }}' is the AWX_HOST environment variable."

- name: Print some variables
vars:
msg: |
Ansible Distribution: {{ ansible_distribution }}
Ansible Dist version: {{ ansible_distribution_version }}
ACM Base Domain {{cluster_deployment['baseDomain']}}
ACM Cluster name {{cluster_deployment['clusterName']}}
API record api.{{cluster_deployment['clusterName']}}.{{cluster_deployment['baseDomain']}}
# Ingress record *.apps.{{cluster_deployment['clusterName']}}.{{cluster_deployment['baseDomain']}}
debug:
msg: "{{ msg.split('\n') }}"

- name: Add an AWS Route53 DNS entry for API (VMware)
debug:
msg: "AWS cluster"
when: cluster_deployment.platform.aws is defined

- name: Add an AWS Route53 DNS entry for API (VMware)
debug:
msg: "VMware cluster"
when: cluster_deployment.platform.vsphere is defined

- name: Add an AWS Route53 DNS entry for API (GCP)
debug:
msg: "GCP cluster"
when: cluster_deployment.platform.gcp is defined

# {% if interfaces.vlan1 is defined %}
# {{ interfaces.vlan1.ip }}
# {% else %}
# {{ interfaces.vlan2.ip|default("127.0.3.1") }}
# {% endif %}
#
# {% if 'vlan1' in interfaces %}

# - name: Add an AWS Route53 DNS entry for API (VMware)
# community.aws.route53:
# command: create
# zone: {{cluster_deployment['baseDomain']}}
# # record: api.{{cluster_deployment['clusterName']}}.{{cluster_deployment['baseDomain']}}
# record: api.{{install_config['metadata']['name']}}.{{install_config['baseDomain']}}
# type: A
# ttl: 7200
# value: {{platform.vsphere.apiVIP}}
# wait: yes
# when: cluster_deployment.platform.vsphere is defined

# - name: Add an AWS Route53 DNS entry for Ingress (VMware)
# community.aws.route53:
# command: create
# zone: {{cluster_deployment['baseDomain']}}
# # record: "*.apps.{{cluster_deployment['clusterName']}}.{{cluster_deployment['baseDomain']}}"
# record: "*.apps.{{install_config['metadata']['name']}}.{{install_config['baseDomain']}}"
# type: A
# ttl: 7200
# value: {{platform.vsphere.ingressVIP}}
# wait: yes
# when: cluster_deployment.platform == vsphere
40 changes: 40 additions & 0 deletions dump-all.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
---
- name: dump all
hosts: all

tasks:
- name: Print Ansible version information
vars:
msg: |
Ansible Distribution: {{ ansible_distribution }}
Ansible Dist version: {{ ansible_distribution_version }}
debug:
msg: "{{ msg.split('\n') }}"
tags: debug_info

- name: Print more debug information
vars:
msg: |
Module Variables ("vars"):
--------------------------------
{{ vars | to_nice_json }}

Environment Variables ("environment"):
--------------------------------
{{ environment | to_nice_json }}

GROUP NAMES Variables ("group_names"):
--------------------------------
{{ group_names | to_nice_json }}

GROUPS Variables ("groups"):
--------------------------------
{{ groups | to_nice_json }}

HOST Variables ("hostvars"):
--------------------------------
{{ hostvars | to_nice_json }}

debug:
msg: "{{ msg.split('\n') }}"
tags: debug_info
7 changes: 7 additions & 0 deletions fail.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
- name: Fail Sample
hosts: all
tasks:
- name: Always Fail
fail:
msg: "Always fail this task!"

48 changes: 48 additions & 0 deletions rhacm-info.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Red Hat Advanced Cluster Management for Kubernetes cluster deployment info
---
- name: Red Hat Advanced Cluster Management managed cluster deployment info
hosts: all
# gather_facts: no
# connection: local

tasks:
- name: Basic env usage
debug:
msg: "'{{ lookup('env', 'AWX_HOST') }}' is the AWX_HOST environment variable."

- name: Print some variables
vars:
msg: |
Ansible Distribution: {{ ansible_distribution }}
Ansible Dist version: {{ ansible_distribution_version }}
ACM Base Domain {{cluster_deployment['baseDomain']}}
ACM Cluster name {{cluster_deployment['clusterName']}}
API record api.{{cluster_deployment['clusterName']}}.{{cluster_deployment['baseDomain']}}
# Ingress record *.apps.{{cluster_deployment['clusterName']}}.{{cluster_deployment['baseDomain']}}
debug:
msg: "{{ msg.split('\n') }}"

- name: Run only for Amazon Web Services
debug:
msg: "AWS cluster"
when: cluster_deployment.platform.aws is defined

- name: Run only for Microsoft Azure
debug:
msg: "Azure cluster"
when: cluster_deployment.platform.azure is defined

- name: Run only for Google Cloud Platform
debug:
msg: "GCP cluster"
when: cluster_deployment.platform.gcp is defined

- name: Run only for Red Hat OpenStack
debug:
msg: "OpenStack cluster"
when: cluster_deployment.platform.openstack is defined

- name: Run only for VMware vSphere
debug:
msg: "VMware cluster"
when: cluster_deployment.platform.vsphere is defined