Skip to content

Latest commit

 

History

History
42 lines (27 loc) · 931 Bytes

README.md

File metadata and controls

42 lines (27 loc) · 931 Bytes

Ansible Init

Setup fresh server(s) to make it ready for Ansible.

It generates SSH Keys on local if not exists, copies to host, and install Python3.

Install Ansible

apt-add-repository --yes --update ppa:ansible/ansible
apt install ansible
ansible --version

Init

Run this command for single server

ansible-playbook -i some-host:host-port, --ask-pass init.yml

Enter server password when prompted.

Note: A , (comma) after host/port is required

To init multiple servers then please setup the hosts (renamed from hosts.example) file in the following format

some-host-1:port ansible_password=host_root_password
some-host-2:port ansible_password=host_root_password

Then run this command

ansible-playbook init.yml

Inspired by prepare-ansible-hosts and ansible-init