项目作者: nhojpatrick
项目描述 :
Ansible Example of Enrollment
高级语言:
项目地址: git://github.com/nhojpatrick/ansible-example-enrollment.git
Vagrant Example of Enrollment
Creation Your Own SSH Key
$ ssh-keygen -f provisioning/.ssh/id_ed25519 -t ed25519 -N "" -C "vagrant@domain.local"
What to do…
Setup
$ vagrant up
Setup touchdown
$ vagrant ssh touchdown
$ vagrant ssh touchdown
vagrant@touchdown:~$ sudo apt install sshpass
vagrant@touchdown:~$ cd /vagrant/setup/
vagrant@touchdown:/vagrant/setup$ ANSIBLE_HOST_KEY_CHECKING=False ansible-playbook -i hosts-p0-dc0 -i hosts-p0-dc1 playbook_0_setup.yaml
Enrollment
vagrant@touchdown:/vagrant/setup$ su - ruser
ruser@touchdown:~$ cd /vagrant/setup/
ruser@touchdown:/vagrant/setup/$ ansible-galaxy collection install ansible.posix
ruser@touchdown:/vagrant/setup/$ ssh-keygen
ruser@touchdown:/vagrant/setup/$ ANSIBLE_HOST_KEY_CHECKING=False ansible-playbook -i hosts-p0-dc0 -i hosts-p0-dc1 playbook_1_enrol_0_known_hosts.yaml --ask-pass
ruser@touchdown:/vagrant/setup/$ ansible-playbook -i hosts-p0-dc0 -i hosts-p0-dc1 playbook_1_enrol_1_authorized_key.yaml --ask-pass
Checking
vagrant@touchdown:/vagrant/setup$ su - ruser
ruser@touchdown:~$ cd /vagrant/setup/
ruser@touchdown:/vagrant/setup/$ ansible-playbook -i hosts-p0-dc0 -i hosts-p0-dc1 playbook_2_check.yaml