|
1 | 1 | = Interacting with Ansible |
2 | 2 |
|
3 | | -When a dataplane service is executed during a role deployment, a corresponding |
4 | | -https://openstack-k8s-operators.github.io/openstack-ansibleee-operator/openstack_ansibleee/[OpenStackAnsibleEE] |
5 | | -resource is created. The OpenStackAnsibleEE resource is the associated ansible |
| 3 | +When a dataplane service is executed during a deployment, a corresponding |
| 4 | +Kubernetes Job is created. This Kubernetes Job is the associated ansible |
6 | 5 | execution with the service. |
7 | 6 |
|
8 | | -OpenStackAnsibleEE resources are reconciled by |
9 | | -https://github.com/openstack-k8s-operators/openstack-ansibleee-operator[openstack-ansibleee-operator]. |
10 | 7 | During reconciliation a |
11 | 8 | https://kubernetes.io/docs/reference/kubernetes-api/workload-resources/job-v1/[Job] |
12 | 9 | resource is created which in turn creates a |
13 | 10 | https://kubernetes.io/docs/reference/kubernetes-api/workload-resources/pod-v1/[Pod] resource. The pod is started with an https://docs.ansible.com/automation-controller/latest/html/userguide/execution_environments.html[Ansible Execution Environment] image, and runs https://ansible.readthedocs.io/projects/runner/en/stable/[ansible-runner]. |
14 | 11 |
|
15 | | -== Retrieving and inspecting OpenStackAnsibleEE resources |
16 | | - |
17 | | -During (or after) a deployment the instances of OpenStackAnsibleEE can be |
18 | | -retrieved from the API. |
19 | | - |
20 | | - oc get openstackansibleee |
21 | | - |
22 | | -Sample output when the default list of services: |
23 | | - |
24 | | - NAME NETWORKATTACHMENTS STATUS MESSAGE |
25 | | - configure-network-edpm-compute True Job completed |
26 | | - configure-os-edpm-compute True Job completed |
27 | | - install-os-edpm-compute True Job completed |
28 | | - libvirt-edpm-compute True Job completed |
29 | | - nova-edpm-compute True Job completed |
30 | | - run-os-edpm-compute True Job completed |
31 | | - telemetry-edpm-compute True Job completed |
32 | | - validate-network-edpm-compute True Job completed |
33 | | - |
34 | | -Querying for pods with the OpenStackAnsibleEE label |
35 | | - |
36 | | - oc get pods -l app=openstackansibleee |
37 | | - |
38 | | -Sample output: |
39 | | - |
40 | | - configure-network-edpm-compute-j6r4l 0/1 Completed 0 3m36s |
41 | | - validate-network-edpm-compute-6g7n9 0/1 Pending 0 0s |
42 | | - validate-network-edpm-compute-6g7n9 0/1 ContainerCreating 0 11s |
43 | | - validate-network-edpm-compute-6g7n9 1/1 Running 0 13s |
44 | | - |
45 | | -Querying for jobs, shows the corresponding job for each OpenStackAnsibleEE resource: |
46 | | - |
47 | | - oc get jobs -l app=openstackansibleee |
48 | | - |
49 | | -Sample output: |
50 | | - |
51 | | - NAME COMPLETIONS DURATION AGE |
52 | | - configure-network-edpm-compute 1/1 8s 2m51s |
53 | | - configure-os-edpm-compute 1/1 8s 2m27s |
54 | | - install-os-edpm-compute 1/1 8s 2m35s |
55 | | - libvirt-edpm-compute 1/1 8s 2m35s |
56 | | - nova-edpm-compute 1/1 8s 2m35s |
57 | | - run-os-edpm-compute 1/1 8s 2m19s |
58 | | - telemetry-edpm-compute 1/1 8s 2m35s |
59 | | - validate-network-edpm-compute 1/1 8s 2m43s |
60 | | - |
61 | | -Using the job name, the corresponding pod can be retrieved: |
62 | | - |
63 | | - oc get pods | grep configure-network-edpm-compute |
64 | | - |
65 | | -Sample output: |
66 | | - |
67 | | - configure-network-edpm-compute-2hshp 0/1 Completed 0 5m45s |
68 | | - |
69 | | -Using the job name, the ansible logs can be retrieved: |
70 | | - |
71 | | - oc logs job.batch/configure-network-edpm-compute |
| 12 | +== Retrieving and inspecting Ansible Execution Jobs |
| 13 | + |
| 14 | +The Kubernetes jobs are labelled with the name of the `OpenStackDataPlaneDeployment`. |
| 15 | +Jobs for each `OpenStackDataPlaneDeployment` can be seen by listing jobs by the label: |
| 16 | + |
| 17 | + $ oc get job -l openstackdataplanedeployment=edpm-compute |
| 18 | + NAME STATUS COMPLETIONS DURATION AGE |
| 19 | + bootstrap-edpm-compute-openstack-edpm-ipam Complete 1/1 78s 25h |
| 20 | + configure-network-edpm-compute-openstack-edpm-ipam Complete 1/1 37s 25h |
| 21 | + configure-os-edpm-compute-openstack-edpm-ipam Complete 1/1 66s 25h |
| 22 | + download-cache-edpm-compute-openstack-edpm-ipam Complete 1/1 64s 25h |
| 23 | + install-certs-edpm-compute-openstack-edpm-ipam Complete 1/1 46s 25h |
| 24 | + install-os-edpm-compute-openstack-edpm-ipam Complete 1/1 57s 25h |
| 25 | + libvirt-edpm-compute-openstack-edpm-ipam Complete 1/1 2m37s 25h |
| 26 | + neutron-metadata-edpm-compute-openstack-edpm-ipam Complete 1/1 61s 25h |
| 27 | + nova-edpm-compute-openstack-edpm-ipam Complete 1/1 3m20s 25h |
| 28 | + ovn-edpm-compute-openstack-edpm-ipam Complete 1/1 78s 25h |
| 29 | + run-os-edpm-compute-openstack-edpm-ipam Complete 1/1 33s 25h |
| 30 | + ssh-known-hosts-edpm-compute Complete 1/1 19s 25h |
| 31 | + telemetry-edpm-compute-openstack-edpm-ipam Complete 1/1 2m5s 25h |
| 32 | + validate-network-edpm-compute-openstack-edpm-ipam Complete 1/1 16s 25h |
| 33 | + |
| 34 | +Logs can be checked using `oc logs -f job/<job-name>`. For example, if we want to check the logs |
| 35 | +from the configure-network job: |
| 36 | + |
| 37 | + $ oc logs -f jobs/configure-network-edpm-compute-openstack-edpm-ipam | tail -n2 |
| 38 | +PLAY RECAP ********************************************************************* |
| 39 | +edpm-compute-0 : ok=22 changed=0 unreachable=0 failed=0 skipped=17 rescued=0 ignored=0 |
72 | 40 |
|
73 | 41 | == Controlling the Ansible execution |
74 | 42 |
|
|
0 commit comments