mirror of
https://gitea.fenix-dev.com/fenix-gitea-admin/iac-ansible-private.git
synced 2026-09-25 00:55:22 +00:00
Compare commits
5 Commits
df214e6ed3
...
7f6d52cfd6
| Author | SHA1 | Date | |
|---|---|---|---|
| 7f6d52cfd6 | |||
| 08d06c4205 | |||
| b0875725c0 | |||
| 74108ecd4d | |||
| c362680267 |
2
ansible.cfg
Normal file
2
ansible.cfg
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
[defaults]
|
||||||
|
timeout = 60
|
||||||
Binary file not shown.
40
roles/metrics/tasks/main.yml
Normal file
40
roles/metrics/tasks/main.yml
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
|
||||||
|
- name: Remover o diretório /tmp/metrics/kubernetes-files
|
||||||
|
ansible.builtin.file:
|
||||||
|
path: /tmp/metrics/kubernetes-files
|
||||||
|
state: absent
|
||||||
|
|
||||||
|
- name: Criar diretório temporário no remoto
|
||||||
|
file:
|
||||||
|
path: /tmp/metrics/kubernetes-files
|
||||||
|
state: directory
|
||||||
|
mode: '0755'
|
||||||
|
|
||||||
|
#- name: Copy file with owner and permissions
|
||||||
|
# ansible.builtin.copy:
|
||||||
|
# src: ../files
|
||||||
|
# dest: /tmp/metrics/kubernetes-files
|
||||||
|
# owner: fenix
|
||||||
|
# group: root
|
||||||
|
# mode: '0644'
|
||||||
|
|
||||||
|
|
||||||
|
#- name: Listar conteúdo do diretório remoto
|
||||||
|
# shell: ls -l /tmp/metrics/kubernetes-files/files
|
||||||
|
# register: resultado_ls
|
||||||
|
|
||||||
|
|
||||||
|
#- name: Mostrar resultado do ls
|
||||||
|
# debug:
|
||||||
|
# var: resultado_ls.stdout_lines
|
||||||
|
|
||||||
|
|
||||||
|
- name: Aplicar o files
|
||||||
|
become: yes
|
||||||
|
become_user: fenix
|
||||||
|
shell: |
|
||||||
|
kubectl apply -f https://github.com/kubernetes-sigs/metrics-server/releases/latest/download/components.yaml
|
||||||
|
|
||||||
|
kubectl patch deployment metrics-server -n kube-system --type='json' -p='[{"op": "add", "path": "/spec/template/spec/containers/0/args/-", "value": "--kubelet-insecure-tls"},{"op": "add", "path": "/spec/template/spec/containers/0/args/-", "value": "--kubelet-preferred-address-types=InternalIP"}]'
|
||||||
|
environment:
|
||||||
|
KUBECONFIG: /home/fenix/.kube/config
|
||||||
@ -30,9 +30,9 @@
|
|||||||
echo "get item"
|
echo "get item"
|
||||||
bw get item "{{ item.id }}" --session $BW_SESSION | jq -r '.notes' > {{ item.dest }}
|
bw get item "{{ item.id }}" --session $BW_SESSION | jq -r '.notes' > {{ item.dest }}
|
||||||
loop:
|
loop:
|
||||||
- { id: "iac.ansible.dockersecrets", dest: "/tmp/monitoring/uptime-kuma/files/docker-secrets.yaml" }
|
- { id: "iac.ansible.dockersecrets", dest: "/tmp/monitoring/uptime-kuma/kubernetes-files/files/docker-secrets.yaml" }
|
||||||
- { id: "iac.ansible.uptimekuma.mariadbsecret", dest: "/tmp/monitoring/uptime-kuma/files/uptime-kuma-secret.yaml" }
|
- { id: "iac.ansible.uptimekuma.mariadbsecret", dest: "/tmp/monitoring/uptime-kuma/kubernetes-files/files/uptime-kuma-secret.yaml" }
|
||||||
- { id: "iac.ansible.uptimekuma.monitorssecret", dest: "/tmp/monitoring/uptime-kuma/files/uptime-kuma-monitors-secret.yaml" }
|
- { id: "iac.ansible.uptimekuma.monitorssecret", dest: "/tmp/monitoring/uptime-kuma/kubernetes-files/files/uptime-kuma-monitors-secret.yaml" }
|
||||||
args:
|
args:
|
||||||
executable: /bin/bash
|
executable: /bin/bash
|
||||||
environment:
|
environment:
|
||||||
|
|||||||
Reference in New Issue
Block a user