项目作者: nhojpatrick

项目描述 :
Ansible Example of Enrollment
高级语言:
项目地址: git://github.com/nhojpatrick/ansible-example-enrollment.git
创建时间: 2021-02-26T09:37:28Z
项目社区:https://github.com/nhojpatrick/ansible-example-enrollment

开源协议:MIT License

下载


Vagrant Example of Enrollment

Creation Your Own SSH Key

  1. $ ssh-keygen -f provisioning/.ssh/id_ed25519 -t ed25519 -N "" -C "vagrant@domain.local"

What to do…

Setup

  1. $ vagrant up

Setup touchdown

  1. $ vagrant ssh touchdown

Configure

  1. $ vagrant ssh touchdown
  2. vagrant@touchdown:~$ sudo apt install sshpass
  3. vagrant@touchdown:~$ cd /vagrant/setup/
  4. vagrant@touchdown:/vagrant/setup$ ANSIBLE_HOST_KEY_CHECKING=False ansible-playbook -i hosts-p0-dc0 -i hosts-p0-dc1 playbook_0_setup.yaml

Enrollment

  1. vagrant@touchdown:/vagrant/setup$ su - ruser
  2. ruser@touchdown:~$ cd /vagrant/setup/
  3. ruser@touchdown:/vagrant/setup/$ ansible-galaxy collection install ansible.posix
  4. ruser@touchdown:/vagrant/setup/$ ssh-keygen
  5. 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
  6. ruser@touchdown:/vagrant/setup/$ ansible-playbook -i hosts-p0-dc0 -i hosts-p0-dc1 playbook_1_enrol_1_authorized_key.yaml --ask-pass

Checking

  1. vagrant@touchdown:/vagrant/setup$ su - ruser
  2. ruser@touchdown:~$ cd /vagrant/setup/
  3. ruser@touchdown:/vagrant/setup/$ ansible-playbook -i hosts-p0-dc0 -i hosts-p0-dc1 playbook_2_check.yaml