1234567891011121314151617181920212223242526272829303132 |
- ---
- - name: Start cobbler on reboot
- hosts: localhost
- connection: local
- gather_facts: false
- tasks:
- - name: Wait for 2 minutes
- pause:
- minutes: 2
- - name: Get cobbler pod name
- command: 'kubectl get pod -n cobbler -l app=cobbler -o jsonpath="{.items[0].metadata.name}"'
- changed_when: false
- register: cobbler_pod_name
- - name: Execute cobbler sync in cobbler container
- command: 'kubectl exec --stdin --tty -n cobbler {{ cobbler_pod_name.stdout }} -- cobbler sync'
- changed_when: true
|