github.skymusic.top/operator-framework/operator-sdk@v0.8.2/doc/ansible/dev/advanced_options.md (about) 1 ## Advanced Options 2 3 This document shows the advanced options available to a developer of an ansible operator. 4 5 ### Watches File Options 6 7 The advanced features can be enabled by adding them to your watches file per GVK. 8 They can go below the `group`, `version`, `kind` and `playbook` or `role`. 9 10 Some features can be overridden per resource via an annotation on that CR. The options that are overridable will have the annotation specified below. 11 12 | Feature | Yaml Key | Description| Annotation for override | default | Documentation | 13 |---------|----------|------------|-------------------------|---------|---------------| 14 | Reconcile Period | `reconcilePeriod` | time between reconcile runs for a particular CR | ansbile.operator-sdk/reconcile-period | 1m | | 15 | Manage Status | `manageStatus` | Allows the ansible operator to manage the conditions section of each resource's status section. | | true | | 16 | Watching Dependent Resources | `watchDependentResources` | Allows the ansible operator to dynamically watch resources that are created by ansible | | true | [dependent_watches.md](dependent_watches.md) | 17 | Watching Cluster-Scoped Resources | `watchClusterScopedResources` | Allows the ansible operator to watch cluster-scoped resources that are created by ansible | | false | | 18 | Max Runner Artifacts | `maxRunnerArtifacts` | Manages the number of [artifact directories](https://ansible-runner.readthedocs.io/en/latest/intro.html#runner-artifacts-directory-hierarchy) that ansible runner will keep in the operator container for each individual resource. | ansible.operator-sdk/max-runner-artifacts | 20 | | 19 | Finalizer | `finalizer` | Sets a finalizer on the CR and maps a deletion event to a playbook or role | | | [finalizers.md](finalizers.md)| 20 21 22 #### Example 23 ```YaML 24 --- 25 - version: v1alpha1 26 group: app.example.com 27 kind: AppService 28 playbook: /opt/ansible/playbook.yml 29 maxRunnerArtifacts: 30 30 reconcilePeriod: 5s 31 manageStatus: False 32 watchDependentResources: False 33 finalizer: 34 name: finalizer.app.example.com 35 vars: 36 state: absent 37 ``` 38 39 40 ### Runner Directory 41 42 The ansible runner will keep information about the ansible run in the container. This is located `/tmp/ansible-operator/runner/<group>/<version>/<kind>/<namespace>/<name>`. To learn more about the runner directory you can read the [ansible-runner docs](https://ansible-runner.readthedocs.io/en/latest/index.html). 43 44 ## Turning off Dependent Watches and Owner Reference Injection 45 46 You may want to manage what your operator watches and the owner references. This means that your operator will need to understand how to clean up after itself when your CR is deleted. To disable these features you will need to edit your `build/Dockerfile` to include the line below. 47 48 **NOTE**: That if you use this feature there will be a warning that dependent watches is turned off but there will be no error. 49 50 ``` 51 ENTRYPOINT ["/usr/local/bin/entrypoint", "--inject-owner-ref=false"] 52 ```