This repository has been archived by the owner on Nov 18, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 131
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Upgrade Ansible Sample to use 0.17 (#119)
- Loading branch information
1 parent
47e5d45
commit dde0c6c
Showing
9 changed files
with
106 additions
and
55 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
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
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,24 @@ | ||
--- | ||
- name: Converge | ||
hosts: localhost | ||
connection: local | ||
gather_facts: no | ||
collections: | ||
- community.kubernetes | ||
|
||
tasks: | ||
- name: Ensure operator image is set | ||
fail: | ||
msg: | | ||
You must specify the OPERATOR_IMAGE environment variable in order to run the | ||
'cluster' scenario | ||
when: not operator_image | ||
|
||
- name: Create the Operator Deployment | ||
k8s: | ||
namespace: '{{ namespace }}' | ||
definition: "{{ lookup('template', '/'.join([template_dir, 'operator.yaml.j2'])) }}" | ||
wait: yes | ||
vars: | ||
image: '{{ operator_image }}' | ||
pull_policy: '{{ operator_pull_policy }}' |
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
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,6 @@ | ||
--- | ||
- name: Converge | ||
hosts: localhost | ||
connection: local | ||
roles: | ||
- memcached |
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
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
42 changes: 42 additions & 0 deletions
42
ansible/memcached-operator/molecule/test-local/converge.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,42 @@ | ||
--- | ||
- name: Build Operator in Kubernetes docker container | ||
hosts: k8s | ||
collections: | ||
- community.kubernetes | ||
|
||
vars: | ||
image: cache.example.com/memcached-operator:testing | ||
|
||
tasks: | ||
# using command so we don't need to install any dependencies | ||
- name: Get existing image hash | ||
command: docker images -q {{ image }} | ||
register: prev_hash_raw | ||
changed_when: false | ||
|
||
- name: Build Operator Image | ||
command: docker build -f /build/build/Dockerfile -t {{ image }} /build | ||
register: build_cmd | ||
changed_when: not hash or (hash and hash not in cmd_out) | ||
vars: | ||
hash: '{{ prev_hash_raw.stdout }}' | ||
cmd_out: '{{ "".join(build_cmd.stdout_lines[-2:]) }}' | ||
|
||
- name: Converge | ||
hosts: localhost | ||
connection: local | ||
collections: | ||
- community.kubernetes | ||
|
||
vars: | ||
image: cache.example.com/memcached-operator:testing | ||
operator_template: "{{ '/'.join([template_dir, 'operator.yaml.j2']) }}" | ||
|
||
tasks: | ||
- name: Create the Operator Deployment | ||
k8s: | ||
namespace: '{{ namespace }}' | ||
definition: "{{ lookup('template', operator_template) }}" | ||
wait: yes | ||
vars: | ||
pull_policy: Never |
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