Ansible Bootstrap: Unterschied zwischen den Versionen
Zur Navigation springen
Zur Suche springen
(→Ssh) |
|||
| Zeile 20: | Zeile 20: | ||
10.82.232.61 ansible_connection=ssh ansible_ssh_user=xinux ansible_ssh_pass=suxer ansible_become_pass=sysadm | 10.82.232.61 ansible_connection=ssh ansible_ssh_user=xinux ansible_ssh_pass=suxer ansible_become_pass=sysadm | ||
10.82.232.62 ansible_connection=ssh ansible_ssh_user=xinux ansible_ssh_pass=suxer ansible_become_pass=sysadm | 10.82.232.62 ansible_connection=ssh ansible_ssh_user=xinux ansible_ssh_pass=suxer ansible_become_pass=sysadm | ||
| − | = | + | =Bootstrap= |
*cat bootstrap.yml | *cat bootstrap.yml | ||
<pre> | <pre> | ||
| Zeile 31: | Zeile 31: | ||
key: "{{ lookup('file', 'authorized_keys') }}" | key: "{{ lookup('file', 'authorized_keys') }}" | ||
become: true | become: true | ||
| + | become_method: su | ||
</pre> | </pre> | ||
Version vom 1. Dezember 2022, 17:27 Uhr
Einstellung
Es liegt hier alles unter ~/ansible
Konfig
- cat ansible.cfg
[defaults] inventory = ~/ansible/hosts library = /usr/share/my_modules/ deprecation_warnings = False retry_files_enabled = False [privilege_escalation] [paramiko_connection] [ssh_connection] [accelerate] [selinux]
Hosts
- cat hosts
[bootstrap] 10.82.232.61 ansible_connection=ssh ansible_ssh_user=xinux ansible_ssh_pass=suxer ansible_become_pass=sysadm 10.82.232.62 ansible_connection=ssh ansible_ssh_user=xinux ansible_ssh_pass=suxer ansible_become_pass=sysadm
Bootstrap
- cat bootstrap.yml
- hosts: bootstrap
tasks:
- name: set auth keys
authorized_key:
user: root
state: present
key: "{{ lookup('file', 'authorized_keys') }}"
become: true
become_method: su