chore: Configure argo workflows permissions
This commit is contained in:
parent
9cbb84a0f3
commit
ac38731dcf
@ -10,6 +10,23 @@
|
||||
# - argo-workflows
|
||||
- firstboot
|
||||
|
||||
- name: Create ClusterRoleBinding for default serviceaccount
|
||||
kubernetes.core.k8s:
|
||||
state: present
|
||||
kubeconfig: "{{ kubeconfig.path }}"
|
||||
definition: |
|
||||
kind: ClusterRoleBinding
|
||||
metadata:
|
||||
name: argo-workflows-firstboot-clusteradmin
|
||||
roleRef:
|
||||
apiGroup: rbac.authorization.k8s.io
|
||||
kind: ClusterRole
|
||||
name: cluster-admin
|
||||
subjects:
|
||||
- kind: ServiceAccount
|
||||
name: default
|
||||
namespace: firstboot
|
||||
|
||||
- name: Install argo-workflows chart
|
||||
kubernetes.core.helm:
|
||||
name: argo-workflows
|
||||
|
@ -85,11 +85,19 @@ components:
|
||||
chart: argo/argo-workflows
|
||||
parse_logic: helm template . | yq --no-doc eval '.. | .image? | select(.)' | sort -u | awk '!/ /'
|
||||
chart_values: !unsafe |
|
||||
# workflow:
|
||||
# serviceAccount:
|
||||
# create: true
|
||||
# name: "argo-workflows"
|
||||
# rbac:
|
||||
# create: true
|
||||
controller:
|
||||
workflowNamespaces:
|
||||
- default
|
||||
- firstboot
|
||||
server:
|
||||
authModes:
|
||||
- server
|
||||
ingress:
|
||||
enabled: true
|
||||
hosts:
|
||||
|
@ -5,12 +5,42 @@
|
||||
- vars/pb.secrets.yaml
|
||||
tasks:
|
||||
|
||||
- name: Retrieve target folder details
|
||||
community.vmware.vmware_vm_info:
|
||||
hostname: "{{ hv.hostname }}"
|
||||
username: "{{ hv.username }}"
|
||||
password: "{{ secrets.hv.password }}"
|
||||
folder: "{{ hv.folder }}"
|
||||
validate_certs: false
|
||||
register: vm_info
|
||||
|
||||
- name: User prompt
|
||||
ansible.builtin.pause:
|
||||
prompt: Virtual machine '{{ appliance.id }}' already exists. Delete to continue [yes] or abort [no]?"
|
||||
register: prompt
|
||||
until:
|
||||
- prompt.user_input in ['yes', 'no']
|
||||
delay: 0
|
||||
when: (vm_info | selectattr('guest_name', 'equalto', appliance.id) | length) > 0
|
||||
|
||||
- name: Destroy existing VM
|
||||
community.vmware.vmware_guest:
|
||||
hostname: "{{ hv.hostname }}"
|
||||
username: "{{ hv.username }}"
|
||||
password: "{{ secrets.hv.password }}"
|
||||
folder: "{{ hv.folder }}"
|
||||
name: appliance.id
|
||||
state: absent
|
||||
when:
|
||||
- (vm_info | selectattr('guest_name', 'equalto', appliance.id) | length) > 0
|
||||
- (prompt.user_input | bool) == true
|
||||
|
||||
- name: Deploy VM from OVA-template
|
||||
community.vmware.vmware_deploy_ovf:
|
||||
hostname: "{{ hv.hostname }}"
|
||||
username: "{{ hv.username }}"
|
||||
password: "{{ secrets.hv.password }}"
|
||||
validate_certs: no
|
||||
validate_certs: false
|
||||
datacenter: "{{ hv.datacenter }}"
|
||||
folder: "{{ hv.folder }}"
|
||||
cluster: "{{ hv.cluster }}"
|
||||
|
Loading…
Reference in New Issue
Block a user