Skip to content

Commit a292c67

Browse files
committed
address review comments
1 parent 52b8b90 commit a292c67

File tree

3 files changed

+11
-17
lines changed

3 files changed

+11
-17
lines changed
Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,16 @@
11
---
2-
- name: Ensure kubernetes.core collection is installed
2+
- name: Deploy kube-prometheus-stack to Kubernetes
33
hosts: masters
44
gather_facts: no
5+
become: yes
6+
57
tasks:
6-
- name: Install required Ansible collection
7-
ansible.builtin.command:
8-
cmd: ansible-galaxy collection install kubernetes.core
8+
- name: Ensure kubernetes.core collection is installed
9+
command: ansible-galaxy collection install kubernetes.core
910
changed_when: false
1011
delegate_to: "{{ groups['masters'][0] }}"
12+
become: no
1113

12-
- name: Install Helm
13-
hosts: masters
14-
become: yes
15-
tasks:
1614
- name: Download Helm install script
1715
ansible.builtin.get_url:
1816
url: https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3
@@ -21,13 +19,9 @@
2119
delegate_to: "{{ groups['masters'][0] }}"
2220

2321
- name: Run Helm install script
24-
ansible.builtin.command: /tmp/get_helm.sh
25-
args:
26-
chdir: /tmp
22+
command: /tmp/get_helm.sh
2723
delegate_to: "{{ groups['masters'][0] }}"
2824

29-
- name: Deploy kube-prometheus-stack to Kubernetes
30-
hosts: masters
31-
become: yes
3225
roles:
33-
- install-monitoring
26+
- role: install-monitoring
27+
name: Deploy kube-prometheus-stack

kubetest2-tf/data/k8s-ansible/roles/install-monitoring/defaults/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
1+
#Default vars for install-monitoring role
22
---
33
helm_release_name: k8s-monitoring
44
helm_chart_name: prometheus-community/kube-prometheus-stack

kubetest2-tf/data/k8s-ansible/roles/install-monitoring/tasks/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
- name: Ensure namespace exists
3-
ansible.builtin.command: kubectl create namespace {{ helm_namespace }}
3+
command: kubectl create namespace {{ helm_namespace }}
44
ignore_errors: yes # Ignore error if namespace already exists
55

66
- name: Ensure Helm repository is added

0 commit comments

Comments
 (0)