@@ -53,6 +53,56 @@ Memcached resource with APIVersion `cache.example.com/v1apha1` and Kind
53
53
To learn more about the project directory structure, see [ project
54
54
layout] [ layout_doc ] doc.
55
55
56
+
57
+ ### Watches file
58
+
59
+ The Watches file contains a list of mappings from custom resources, identified
60
+ by it's Group, Version, and Kind, to an Ansible Role or Playbook. The Operator
61
+ expects this mapping file in a predefined location: ` /opt/ansible/watches.yaml `
62
+
63
+ * ** group** : The group of the Custom Resource that you will be watching.
64
+ * ** version** : The version of the Custom Resource that you will be watching.
65
+ * ** kind** : The kind of the Custom Resource that you will be watching.
66
+ * ** role** (default): This is the path to the role that you have added to the
67
+ container. For example if your roles directory is at ` /opt/ansible/roles/ `
68
+ and your role is named ` busybox ` , this value will be
69
+ ` /opt/ansible/roles/busybox ` . This field is mutually exclusive with the
70
+ "playbook" field.
71
+ * ** playbook** : This is the path to the playbook that you have added to the
72
+ container. This playbook is expected to be simply a way to call roles. This
73
+ field is mutually exclusive with the "role" field.
74
+ * ** reconcilePeriod** (optional): The reconciliation interval, how often the
75
+ role/playbook is run, for a given CR.
76
+ * ** manageStatus** (optional): Specifies who is managing the status for the CR.
77
+ Set to ` false ` when you want the role/playbook to be solely responsible for
78
+ the CR's status.
79
+
80
+ An example Watches file:
81
+
82
+ ``` yaml
83
+ ---
84
+ # Simple example mapping Foo to the Foo role
85
+ - version : v1alpha1
86
+ group : foo.example.com
87
+ kind : Foo
88
+ role : /opt/ansible/roles/Foo
89
+
90
+ # Simple example mapping Bar to a playbook
91
+ - version : v1alpha1
92
+ group : bar.example.com
93
+ kind : Bar
94
+ playbook : /opt/ansible/playbook.yaml
95
+
96
+ # More complex example for our Baz kind
97
+ # Here we will disable requeuing and be managing the CR status in the playbook
98
+ - version : v1alpha1
99
+ group : baz.example.com
100
+ kind : Baz
101
+ playbook : /opt/ansible/baz.yaml
102
+ reconcilePeriod : 0
103
+ manageStatus : false
104
+ ` ` `
105
+
56
106
## Customize the operator logic
57
107
58
108
For this example the memcached-operator will execute the following
0 commit comments