refactor: install ansible with Python venv (#863)
This commit is contained in:
1 parent
e4d1fa15d6
commit
571a7454c0
15 files changed
+85
-153
No files matched your search
@@ -1,18 +1,18 @@
|
||||
---
|
||||
- name: Query age key file
|
||||
ansible.builtin.stat:
|
||||
path: ~/.config/sops/age/keys.txt
|
||||
path: "{{ repository_path }}/age.key"
|
||||
register: result
|
||||
|
||||
- name: Check if age key file exists
|
||||
ansible.builtin.assert:
|
||||
that: result.stat.exists
|
||||
success_msg: Age file ~/.config/sops/age/keys.txt exists
|
||||
fail_msg: Age file ~/.config/sops/age/keys.txt does not exist
|
||||
success_msg: Age file {{ repository_path }}/age.key exists
|
||||
fail_msg: Age file {{ repository_path }}/age.key does not exist
|
||||
|
||||
- name: Query age key file contents
|
||||
ansible.builtin.set_fact:
|
||||
age_contents: "{{ lookup('file', '~/.config/sops/age/keys.txt') }}"
|
||||
age_contents: "{{ lookup('file', repository_path + '/age.key') }}"
|
||||
|
||||
- name: Check if age public keys match
|
||||
ansible.builtin.assert:
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
- name: Check for required CLI tools
|
||||
ansible.builtin.shell: |
|
||||
command -v {{ item }} >/dev/null 2>&1
|
||||
loop: [age, cloudflared, flux, git, pip3, sops, task]
|
||||
loop: [age, cloudflared, flux, sops]
|
||||
changed_when: false
|
||||
check_mode: false
|
||||
register: result
|
||||
|
||||
@@ -1,35 +0,0 @@
|
||||
[defaults]
|
||||
# General settings
|
||||
nocows = True
|
||||
executable = /bin/bash
|
||||
stdout_callback = yaml
|
||||
force_valid_group_names = ignore
|
||||
# File/Directory settings
|
||||
log_path = ~/.ansible/ansible.log
|
||||
inventory = ./inventory
|
||||
roles_path = ~/.ansible/roles:./roles
|
||||
collections_path = ~/.ansible/collections
|
||||
remote_tmp = ~/.ansible/tmp
|
||||
local_tmp = ~/.ansible/tmp
|
||||
# Fact Caching settings
|
||||
fact_caching = jsonfile
|
||||
fact_caching_connection = ~/.ansible/facts_cache
|
||||
# SSH settings
|
||||
remote_port = 22
|
||||
timeout = 60
|
||||
host_key_checking = False
|
||||
# Plugin settings
|
||||
vars_plugins_enabled = host_group_vars,community.sops.sops
|
||||
|
||||
[inventory]
|
||||
unparsed_is_failed = True
|
||||
|
||||
[privilege_escalation]
|
||||
become = True
|
||||
|
||||
[ssh_connection]
|
||||
scp_if_ssh = smart
|
||||
retries = 3
|
||||
ssh_args = -o ControlMaster=auto -o ControlPersist=30m -o Compression=yes -o ServerAliveInterval=15s
|
||||
pipelining = True
|
||||
control_path = %(directory)s/%%h-%%r
|
||||
@@ -41,7 +41,7 @@
|
||||
|
||||
- name: Drain
|
||||
ansible.builtin.command: "kubectl drain --ignore-daemonsets --delete-emptydir-data --force {% raw %}{{ inventory_hostname }}{% endraw %}"
|
||||
delegate_to: "{{ groups['master'][0] }}"
|
||||
delegate_to: "{% raw %}{{ groups['master'][0] }}{% endraw %}"
|
||||
changed_when: false
|
||||
|
||||
- name: Update
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
openshift==0.13.1
|
||||
@@ -1,16 +0,0 @@
|
||||
---
|
||||
collections:
|
||||
- name: ansible.posix
|
||||
version: 1.5.4
|
||||
- name: ansible.utils
|
||||
version: 2.10.3
|
||||
- name: community.general
|
||||
version: 7.2.0
|
||||
- name: community.sops
|
||||
version: 1.6.4
|
||||
- name: kubernetes.core
|
||||
version: 2.4.0
|
||||
roles:
|
||||
- name: xanmanning.k3s
|
||||
src: https://github.com/PyratLabs/ansible-role-k3s.git
|
||||
version: v3.4.2
|
||||
Reference in new issue
Block a user