Unverified Commit 6cfb3769 authored by G33tha's avatar G33tha Committed by GitHub
Browse files

Create namespace.yml

Showing with 39 additions and 0 deletions
+39 -0
---
# tasks file for creating namespace and imagepull secrets
- hosts: local
gather_facts: false
environment:
KUBECONFIG: "{{ kubeconfig_path }}"
serial: 1
vars:
helm_vars:
reloader:
watchGlobally: false
vars_files:
- "{{inventory_dir}}/secrets.yml"
pre_tasks:
- name: Creating tmp file
tempfile:
state: file
suffix: helm
register: helm_file
- name: Creating helm_charts vars file
copy:
content: "{{ helm_vars|to_yaml }}"
dest: "{{ helm_file.path }}"
- name: Creating namespace
shell: "kubectl create namespace {{ item }} "
with_items:
- "{{ bootstrap_namespace.split(',') }}"
ignore_errors: yes
- name: Creating docker secrets
shell: "kubectl create secret docker-registry {{ imagepullsecrets }} --namespace {{ item }} --docker-server {{ vault_docker_registry_url }} --docker-username {{ vault_docker_registry_user }} --docker-password {{ vault_docker_registry_password }} --dry-run=client -o=yaml | kubectl apply -f -"
when: imagepullsecrets|length > 0
with_items:
- "{{ bootstrap_namespace.split(',') }}"
- name: Installing reloader for configmaps reload
shell: helm upgrade --install --atomic reloader "{{ playbook_dir }}"/../helm_charts/core/reloader --namespace "{{ item }}" -f "{{ helm_file.path }}"
with_items:
- "{{ bootstrap_namespace.split(',') }}"
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment