Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save mhalano/e1b3f05e47e428c5739ad87b46a36ddc to your computer and use it in GitHub Desktop.
Save mhalano/e1b3f05e47e428c5739ad87b46a36ddc to your computer and use it in GitHub Desktop.
- hosts: localhost
vars:
namespace: awx
service_type: NodePort
tasks:
- name: Create a k8s namespace
kubernetes.core.k8s:
name: awx
api_version: v1
kind: Namespace
state: present
- name: Look up release
uri:
url: "https://api.github.com/repos/ansible/awx-operator/releases/latest"
register: release
ignore_errors: yes
- name: Creating a file with content
copy:
dest: "./kustomization.yaml"
content: |
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- github.com/ansible/awx-operator/config/default?ref={{ release.json.tag_name }}
images:
- name: quay.io/ansible/awx-operator
newTag: {{ release.json.tag_name }}
namespace: awx
- name: Create kubernetes resources for lookup output
kubernetes.core.k8s:
definition: "{{ lookup('kubernetes.core.kustomize', dir='.') }}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment