-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #146 from fahedouch/refacto-ansible-examples
refacto ansible examples
- Loading branch information
Showing
8 changed files
with
82 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 1 addition & 3 deletions
4
examples/ansible/ansibleRun-remote-host.yml → ...inventory/ansibleRun-inline-inventory.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
examples/ansible/inventory/ansibleRun-inventory-from-secret.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
apiVersion: v1 | ||
kind: Secret | ||
metadata: | ||
namespace: crossplane-system | ||
name: inventory | ||
type: Opaque | ||
data: | ||
hosts: QkFTRTY0RU5DT0RFRF9QUk9WSURFUl9DUkVEUw== | ||
--- | ||
apiVersion: ansible.crossplane.io/v1alpha1 | ||
kind: AnsibleRun | ||
metadata: | ||
name: secret-inventory-remote-debug | ||
spec: | ||
forProvider: | ||
inventories: | ||
- source: Secret | ||
secretRef: | ||
namespace: crossplane-system | ||
name: inventory | ||
key: hosts | ||
# AnsibleRun default to using a remote source. | ||
# For simple cases you can use an inline source to specify the content of | ||
# playbook.yaml as opaque, inline yaml. | ||
playbookInline: | | ||
--- | ||
- hosts: all | ||
tasks: | ||
- name: ansibleplaybook-simple | ||
debug: | ||
msg: Your are running 'ansibleplaybook-simple' example |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 49 additions & 0 deletions
49
examples/ansible/runPolicy/ansibleRun-checkWhenObserve-policy.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
apiVersion: ansible.crossplane.io/v1alpha1 | ||
kind: AnsibleRun | ||
metadata: | ||
annotations: | ||
ansible.crossplane.io/runPolicy: CheckWhenObserve | ||
name: gcpdisk | ||
spec: | ||
forProvider: | ||
# AnsibleRun default to using a remote source | ||
# For simple cases you can use an inline source to specify the content of | ||
# playbook.yaml as opaque, inline yaml. | ||
roles: | ||
- name: ansible_provider.gcpdisk_role | ||
src: https://github.com/multicloudlab/crossplane-ansible-provider-sample.git | ||
vars: | ||
project: | ||
disk: | ||
size: 20 | ||
key: 718BDCC469891 | ||
zone: europe-west1-b | ||
id: test_project | ||
providerConfigRef: | ||
name: gcpconfig | ||
--- | ||
apiVersion: v1 | ||
kind: Secret | ||
metadata: | ||
namespace: crossplane-system | ||
name: gcp-credentials | ||
type: Opaque | ||
data: | ||
credentials: QkFTRTY0RU5DT0RFRF9QUk9WSURFUl9DUkVEUw== | ||
--- | ||
apiVersion: ansible.crossplane.io/v1alpha1 | ||
kind: ProviderConfig | ||
metadata: | ||
name: gcpconfig | ||
spec: | ||
# Note that unlike most provider configs this one supports an array of | ||
# credentials. This is because each Ansible playbook uses a single | ||
# Crossplane provider config, but could use multiple providers each | ||
# with their own credentials. | ||
credentials: | ||
- filename: gcp-credentials.json | ||
source: Secret | ||
secretRef: | ||
namespace: crossplane-system | ||
name: gcp-credentials | ||
key: credentials |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters