Skip to content

Commit

Permalink
Drop external role dependencies (#32)
Browse files Browse the repository at this point in the history
  • Loading branch information
teddyphreak authored Dec 21, 2023
1 parent ecbfece commit 5b62eb9
Show file tree
Hide file tree
Showing 19 changed files with 26 additions and 30 deletions.
6 changes: 2 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,11 +148,9 @@ Zalando parameters:

## Dependencies

The below python roles are needed on the host that executes this module:
* nephelaiio.plugins

The below python collections are needed on the host that executes this module:
The below Ansible collections are needed on the host that executes this module:
* ansible.utils
* nephelaiio.plugins

### System

Expand Down
2 changes: 1 addition & 1 deletion defaults/main/nginx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ k8s_nginx_namespace: "nginx"
k8s_nginx_chart:
name: "ingress-nginx"
repo: "https://kubernetes.github.io/ingress-nginx"
release: "4.8.4"
release: "4.8.3"
last_checked: "2023-12-08T15:44:06-06:00"
k8s_nginx_wait_timeout: "{{ k8s_wait_timeout }}"
5 changes: 2 additions & 3 deletions meta/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ galaxy_info:
author: nephelaiio
description: Ansible role to bootstrap k8s cluster deployment
license: MIT
min_ansible_version: 2.8
min_ansible_version: '2.8'
platforms:
- name: EL
versions:
Expand All @@ -18,5 +18,4 @@ galaxy_info:
- all
galaxy_tags: ['k8s']

dependencies:
- nephelaiio.plugins
dependencies: []
6 changes: 3 additions & 3 deletions molecule/common/create.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
ansible.builtin.include_role:
name: nephelaiio.kind
vars:
kind_image_tag: "{{ lookup('env', 'K8S_RELEASE') | default('v1.24.4') }}"
kind_image_tag: "{{ lookup('ansible.builtin.env', 'K8S_RELEASE') | default('v1.24.4') }}"

when: k8s_molecule_cluster_type == 'kind'

Expand All @@ -38,7 +38,7 @@
- name: deploy k3s cluster
ansible.builtin.command: "{{ tempdir.path }}/k3s --disable=traefik"
vars:
k3s_version: "{{ lookup('env', 'K8S_RELEASE') }}+k3s1"
k3s_version: "{{ lookup('ansible.builtin.env', 'K8S_RELEASE') }}+k3s1"
environment:
INSTALL_K3S_VERSION: "{{ k3s_version }}"
become: true
Expand All @@ -61,7 +61,7 @@
group: "{{ ansible_user }}"
mode: 0600
vars:
ansible_user: "{{ lookup('env', 'USER') }}"
ansible_user: "{{ lookup('ansible.builtin.env', 'USER') }}"
become: true

- name: remove k3s tempdir
Expand Down
2 changes: 1 addition & 1 deletion molecule/common/destroy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
vars:
kind_state: absent
kind_cluster_state: absent
kind_image_tag: "{{ lookup('env', 'K8S_RELEASE') }}"
kind_image_tag: "{{ lookup('ansible.builtin.env', 'K8S_RELEASE') }}"

when: k8s_molecule_cluster_type == 'kind'

Expand Down
2 changes: 1 addition & 1 deletion molecule/common/prepare.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
tasks:

- name: check local helm binary
ansible.builtin.shell: "which {{ lookup('env', 'HELM_BIN', default='helm') }}"
ansible.builtin.shell: "which {{ lookup('ansible.builtin.env', 'HELM_BIN', default='helm') }}"
register: helm_bin_query
changed_when: false

Expand Down
2 changes: 1 addition & 1 deletion requirements.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
roles:
- nephelaiio.plugins
- nephelaiio.kind
collections:
- nephelaiio.plugins
- community.general
- ansible.utils
4 changes: 2 additions & 2 deletions tasks/deploy/argocd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
wait_timeout: "{{ k8s_argocd_wait_timeout }}s"
values: "{{ k8s_argocd_chart_values }}"
kubeconfig: "{{ k8s_kubeconfig | default(omit) }}"
binary_path: "{{ lookup('env', 'HELM_BIN', default=k8s_helm_bin) }}"
binary_path: "{{ lookup('ansible.builtin.env', 'HELM_BIN', default=k8s_helm_bin) }}"

- name: Query argocd-repo-server definition
ansible.builtin.set_fact:
Expand Down Expand Up @@ -104,4 +104,4 @@
wait_timeout: "{{ k8s_argocd_apps_wait_timeout }}s"
values: "{{ k8s_argocd_apps_chart_values }}"
kubeconfig: "{{ k8s_kubeconfig | default(omit) }}"
binary_path: "{{ lookup('env', 'HELM_BIN', default=k8s_helm_bin) }}"
binary_path: "{{ lookup('ansible.builtin.env', 'HELM_BIN', default=k8s_helm_bin) }}"
2 changes: 1 addition & 1 deletion tasks/deploy/certmanager.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
wait: true
wait_timeout: "{{ k8s_certmanager_wait_timeout }}s"
kubeconfig: "{{ k8s_kubeconfig | default(omit) }}"
binary_path: "{{ lookup('env', 'HELM_BIN', default=k8s_helm_bin) }}"
binary_path: "{{ lookup('ansible.builtin.env', 'HELM_BIN', default=k8s_helm_bin) }}"
values:
installCRDs: true
podDnsPolicy: None
Expand Down
5 changes: 2 additions & 3 deletions tasks/deploy/check.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
- name: Check cluster type input
ansible.builtin.fail:
msg: 'k8s_cluster_type must be one of [{{ valid_cluster_types | map(''map_format'', "''%s''") | join('', '') }}]'
msg: "k8s_cluster_type must be one of [{{ valid_cluster_types | join(', ') }}]"
vars:
valid_cluster_types:
- local
Expand Down Expand Up @@ -65,8 +65,7 @@
- name: Check certmanager name
ansible.builtin.fail:
msg: >
'k8s_certmanager_issuer_name must be one of
[{{ valid_issuer_names | map(''map_format'', "''%s''") | join('', '') }}]'
k8s_certmanager_issuer_name must be one of [{{ valid_issuer_names | join(', ') }}]
vars:
valid_issuer_names:
- local
Expand Down
2 changes: 1 addition & 1 deletion tasks/deploy/longhorn.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@
wait: true
wait_timeout: "{{ k8s_longhorn_wait_timeout }}s"
kubeconfig: "{{ k8s_kubeconfig | default(omit) }}"
binary_path: "{{ lookup('env', 'HELM_BIN', default=k8s_helm_bin) }}"
binary_path: "{{ lookup('ansible.builtin.env', 'HELM_BIN', default=k8s_helm_bin) }}"
values: "{{ k8s_longhorn_chart_values }}"
2 changes: 1 addition & 1 deletion tasks/deploy/metallb.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
speaker:
secretValue: "{{ k8s_metallb_speaker_secret }}"
kubeconfig: "{{ k8s_kubeconfig | default(omit) }}"
binary_path: "{{ lookup('env', 'HELM_BIN', default=k8s_helm_bin) }}"
binary_path: "{{ lookup('ansible.builtin.env', 'HELM_BIN', default=k8s_helm_bin) }}"

- name: Create metallb pools
kubernetes.core.k8s:
Expand Down
2 changes: 1 addition & 1 deletion tasks/deploy/nginx/aws.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
wait_timeout: "{{ k8s_nginx_wait_timeout }}"
create_namespace: true
kubeconfig: "{{ k8s_kubeconfig | default(omit) }}"
binary_path: "{{ lookup('env', 'HELM_BIN', default=k8s_helm_bin) }}"
binary_path: "{{ lookup('ansible.builtin.env', 'HELM_BIN', default=k8s_helm_bin) }}"
values:
controller:
allowSnippetAnnotations: true
Expand Down
2 changes: 1 addition & 1 deletion tasks/deploy/nginx/local.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
wait_timeout: "{{ k8s_nginx_wait_timeout }}s"
create_namespace: true
kubeconfig: "{{ k8s_kubeconfig | default(omit) }}"
binary_path: "{{ lookup('env', 'HELM_BIN', default=k8s_helm_bin) }}"
binary_path: "{{ lookup('ansible.builtin.env', 'HELM_BIN', default=k8s_helm_bin) }}"
values:
controller:
allowSnippetAnnotations: true
Expand Down
2 changes: 1 addition & 1 deletion tasks/deploy/opensearch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@
wait: true
wait_timeout: "{{ k8s_opensearch_wait_timeout }}s"
kubeconfig: "{{ k8s_kubeconfig | default(omit) }}"
binary_path: "{{ lookup('env', 'HELM_BIN', default=k8s_helm_bin) }}"
binary_path: "{{ lookup('ansible.builtin.env', 'HELM_BIN', default=k8s_helm_bin) }}"
2 changes: 1 addition & 1 deletion tasks/deploy/strimzi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@
wait: true
wait_timeout: "{{ k8s_strimzi_wait_timeout }}s"
kubeconfig: "{{ k8s_kubeconfig | default(omit) }}"
binary_path: "{{ lookup('env', 'HELM_BIN', default=k8s_helm_bin) }}"
binary_path: "{{ lookup('ansible.builtin.env', 'HELM_BIN', default=k8s_helm_bin) }}"
values:
watchAnyNamespace: true
2 changes: 1 addition & 1 deletion tasks/deploy/zalando.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
wait: true
wait_timeout: "{{ k8s_zalando_wait_timeout }}s"
kubeconfig: "{{ k8s_kubeconfig | default(omit) }}"
binary_path: "{{ lookup('env', 'HELM_BIN', default=k8s_helm_bin) }}"
binary_path: "{{ lookup('ansible.builtin.env', 'HELM_BIN', default=k8s_helm_bin) }}"
values:
configKubernetes:
secret_name_template: "{{ k8s_zalando_secret_template }}"
Expand Down
2 changes: 1 addition & 1 deletion tasks/verify/helm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

- name: Record helm deployment metadata
ansible.builtin.set_fact:
helm_failed: "{{ helm_errors | map('map_join', ['namespace', 'name', 'app_version'], '.') }}"
helm_failed: "{{ helm_errors | map('nephelaiio.plugins.map_join', ['namespace', 'name', 'app_version'], '.') }}"
vars:
helm_deployments: "{{ helm_query.stdout | from_json }}"
helm_errors: "{{ helm_deployments | rejectattr('status', 'equalto', 'deployed') }}"
Expand Down
4 changes: 2 additions & 2 deletions tasks/verify/install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,13 @@
ansible.builtin.stat:
path: "{{ _home }}/.pki/nssdb"
vars:
_home: "{{ lookup('env', 'HOME') }}"
_home: "{{ lookup('ansible.builtin.env', 'HOME') }}"
register: truststore_file

- name: Install certificate in edge truststore
ansible.builtin.command: "certutil -d sql:{{ _home }}/.pki/nssdb -A -t C,, -n {{ k8s_cluster_name }} -i {{ k8s_cacert_path }}"
vars:
_home: "{{ lookup('env', 'HOME') }}"
_home: "{{ lookup('ansible.builtin.env', 'HOME') }}"
changed_when: false
when: truststore_file.stat.exists

Expand Down

0 comments on commit 5b62eb9

Please sign in to comment.