AnsibleRun represents a set of Ansible Playbooks.
Type
CRD
Group
ansible.crossplane.io
Version
v1alpha1
apiVersion: ansible.crossplane.io/v1alpha1
kind: AnsibleRun
A AnsibleRunSpec defines the desired state of a AnsibleRun.
AnsibleRunParameters are the configurable fields of a AnsibleRun.
The Inventories of this AnsibleRun.
Env is a reference to an environment variable that contains credentials that must be used to connect to the provider.
Fs is a reference to a filesystem location that contains credentials that must be used to connect to the provider.
The remote configuration of this AnsibleRun; the content can be retrieved from Ansible Galaxy as community contents This field is mutually exclusive with the “roles” field.
ProviderConfigReference specifies how the provider that will be used to create, observe, update, and delete this managed resource should be configured.
Policies for referencing.
ProviderReference specifies the provider that will be used to create, observe, update, and delete this managed resource. Deprecated: Please use ProviderConfigReference, i.e. providerConfigRef
Policies for referencing.
PublishConnectionDetailsTo specifies the connection secret config which contains a name, metadata and a reference to secret store config to which any connection details for this managed resource should be written. Connection details frequently include the endpoint, username, and password required to connect to the managed resource.
WriteConnectionSecretToReference specifies the namespace and name of a Secret to which any connection details for this managed resource should be written. Connection details frequently include the endpoint, username, and password required to connect to the managed resource. This field is planned to be replaced in a future release in favor of PublishConnectionDetailsTo. Currently, both could be set independently and connection details would be published to both without affecting each other.
A AnsibleRunStatus represents the observed state of a AnsibleRun.
Conditions of the resource.
gcpbucket
apiVersion: ansible.crossplane.io/v1alpha1
kind: AnsibleRun
metadata:
annotations:
ansible.crossplane.io/runPolicy: ObserveAndDelete
name: gcpbucket
spec:
forProvider:
playbookInline: |
---
- hosts: localhost
pre_tasks:
- name: Install requests python package on version 2.28.1
ansible.builtin.pip:
name: requests==2.28.1
extra_args: --user
- name: Install google-auth python package on version 2.12.0
ansible.builtin.pip:
name: google-auth==2.12.0
extra_args: --user
tasks:
- name: create a gcp bucket
google.cloud.gcp_storage_bucket:
# please make sure that name is unique
name: ansible-storage-module
project: test-project
auth_kind: serviceaccount
service_account_file: gcp-credentials.json
state: present
when: ansible_provider_meta.gcpbucket.state == 'present'
providerConfigRef:
name: default
secret-inventory-remote-debug
apiVersion: ansible.crossplane.io/v1alpha1
kind: AnsibleRun
metadata:
name: secret-inventory-remote-debug
spec:
forProvider:
inventories:
- secretRef:
key: hosts
name: inventory
namespace: crossplane-system
source: Secret
playbookInline: |
---
- hosts: all
tasks:
- name: ansibleplaybook-simple
debug:
msg: Your are running 'ansibleplaybook-simple' example
gcpdisk
apiVersion: ansible.crossplane.io/v1alpha1
kind: AnsibleRun
metadata:
annotations:
ansible.crossplane.io/runPolicy: CheckWhenObserve
name: gcpdisk
spec:
forProvider:
roles:
- name: ansible_provider.gcpdisk_role
src: https://github.com/multicloudlab/crossplane-ansible-provider-sample.git
vars:
project:
disk:
key: 718BDCC469891
size: 20
zone: europe-west1-b
id: test_project
providerConfigRef:
name: gcpconfig
inline-inventory-remote-debug
apiVersion: ansible.crossplane.io/v1alpha1
kind: AnsibleRun
metadata:
name: inline-inventory-remote-debug
spec:
forProvider:
inventoryInline: |
127.14.1.2
playbookInline: |
---
- hosts: all
tasks:
- name: ansibleplaybook-simple
debug:
msg: Your are running 'ansibleplaybook-simple' example
© 2022 Upbound, Inc.
Discover the building blocksfor your internal cloud platform.