Skip to content

Commit

Permalink
🚨(playbook) use the k8s_info module instead k8s_facts
Browse files Browse the repository at this point in the history
The ansible module `k8s_facts` is deprecated in ansible 2.9.
It has been renamed to `k8s_info`.
  • Loading branch information
madmatah committed Jan 15, 2020
1 parent a45c83b commit b9a049c
Show file tree
Hide file tree
Showing 10 changed files with 15 additions and 11 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ Versioning](http://semver.org/spec/v2.0.0.html).

## Unreleased

### Changed

- Use the `k8s_info` module instead of the deprecated `k8s_facts` module

### Fixed

- Avoid downtime during a switch or rollback
Expand Down
2 changes: 1 addition & 1 deletion create_redirect.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
# Check if the nginx service already exists and recreate it only if not
# (parts of an OpenShift Service definition are immutable).
- name: Check if the redirect nginx service already exists
k8s_facts:
k8s_info:
api_version: "v1"
namespace: "{{ project_name }}"
kind: "Service"
Expand Down
2 changes: 1 addition & 1 deletion delete_project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
# We must check if the project exists first. Without this condition, k8s
# will try to delete a missing project and returns a 403 ¯\_(ツ)_/¯
- name: Check if project exists
k8s_facts:
k8s_info:
api_version: v1
kind: Project
field_selectors:
Expand Down
2 changes: 1 addition & 1 deletion tasks/check_app_secrets.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
- name: Handle permission on Secret objects
block:
- name: "Get created application secrets for {{ app.name }}"
k8s_facts:
k8s_info:
api_version: "v1"
namespace: "{{ project_name }}"
kind: Secret
Expand Down
2 changes: 1 addition & 1 deletion tasks/clean_app_orphans.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
}}"

- name: "Select objects (CM + pods) for app {{ app.name }}"
k8s_facts:
k8s_info:
api_version: "v1"
namespace: "{{ project_name }}"
kind: "{{ item }}"
Expand Down
2 changes: 1 addition & 1 deletion tasks/create_app_builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
tags: build

- name: Wait for target images to be available
k8s_facts:
k8s_info:
api_version: "v1"
namespace: "{{ project_name }}"
kind: "ImageStreamTag"
Expand Down
4 changes: 2 additions & 2 deletions tasks/delete_app_objects_kind.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Delete a kind of objects for the targeted deployment_stamp
- name: Lookup {{ kind }} to delete with deployment_stamp {{ targeted_deployment_stamp }} for app {{ app.name }}
k8s_facts:
k8s_info:
api_version: "v1"
namespace: "{{ project_name }}"
kind: "{{ kind }}"
Expand All @@ -21,7 +21,7 @@
loop_var: object

- name: Wait for objects of kind {{ kind }} to be deleted
k8s_facts:
k8s_info:
api_version: "v1"
namespace: "{{ project_name }}"
kind: "{{ kind }}"
Expand Down
4 changes: 2 additions & 2 deletions tasks/deploy_get_stamp_from_route.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# then the service targeted by this route. TThis service will be labelled with the
# deploy_stamp we are looking for.
- name: Get route for application {{ app.name }} with prefix {{ prefix }}
k8s_facts:
k8s_info:
api_version: "v1"
namespace: "{{ project_name }}"
kind: "Route"
Expand All @@ -18,7 +18,7 @@
when: routes | length > 0 and app.settings.is_blue_green_compatible | default(True)

- name: Get targeted service
k8s_facts:
k8s_info:
api_version: "v1"
namespace: "{{ project_name }}"
kind: "Service"
Expand Down
2 changes: 1 addition & 1 deletion tasks/manage_app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
when: app.settings.is_blue_green_compatible | default(True) == True

- name: Wait for pods to be running
k8s_facts:
k8s_info:
api_version: "v1"
namespace: "{{ project_name }}"
kind: "Pod"
Expand Down
2 changes: 1 addition & 1 deletion tasks/run_job.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
- job

- name: Wait for job completion
k8s_facts:
k8s_info:
api_version: "v1"
namespace: "{{ project_name }}"
kind: "Job"
Expand Down

0 comments on commit b9a049c

Please sign in to comment.