Ansible: Unterschied zwischen den Versionen
Zur Navigation springen
Zur Suche springen
(Die Seite wurde neu angelegt: „== Links == == Zielsetzung == Hilfestellung für die Serververwaltungssoftware Ansible. == Installation neuer Server == <syntaxhighlight lang="bash"> STD_USE…“) |
|||
(Eine dazwischenliegende Version desselben Benutzers wird nicht angezeigt) | |||
Zeile 10: | Zeile 10: | ||
apt install ansible | apt install ansible | ||
adduser $STD_USER | adduser $STD_USER | ||
echo "= store the password at a secure place" | |||
adduser --firstuid=260 --firstgid=260 ansadm | |||
echo "= add ansadm to the wheel users without password: ALL=NOPASSWD: ALL" | |||
vi /etc/sudoers | |||
cp /etc/hostname /etc/hostname.orig | cp /etc/hostname /etc/hostname.orig | ||
echo $HOST >/etc/hostname | echo $HOST >/etc/hostname | ||
reboot | reboot | ||
</syntaxhighlight> | |||
== Aktionen auf dem lokalen Rechner == | |||
<syntaxhighlight lang="bash"> | |||
HOST=host1.example.com | |||
sudo sudo -u ansadm -s | |||
ssh-copy-id $HOST | |||
ansible all -a "tail -1 /etc/shadow" | |||
# | |||
ANS_HOME=/home/ws/ansible/$HOST | |||
cd $ANS_HOME | |||
ansible-playbook playbook/i_10_basic.yaml | |||
</syntaxhighlight> | </syntaxhighlight> |
Aktuelle Version vom 2. April 2025, 21:10 Uhr
Links[Bearbeiten]
Zielsetzung[Bearbeiten]
Hilfestellung für die Serververwaltungssoftware Ansible.
Installation neuer Server[Bearbeiten]
STD_USER=wk
HOST=host1.example.com
apt install ansible
adduser $STD_USER
echo "= store the password at a secure place"
adduser --firstuid=260 --firstgid=260 ansadm
echo "= add ansadm to the wheel users without password: ALL=NOPASSWD: ALL"
vi /etc/sudoers
cp /etc/hostname /etc/hostname.orig
echo $HOST >/etc/hostname
reboot
Aktionen auf dem lokalen Rechner[Bearbeiten]
HOST=host1.example.com
sudo sudo -u ansadm -s
ssh-copy-id $HOST
ansible all -a "tail -1 /etc/shadow"
#
ANS_HOME=/home/ws/ansible/$HOST
cd $ANS_HOME
ansible-playbook playbook/i_10_basic.yaml