2020年4月17日 星期五

Ansible

1. Install ansible & ssh packages first
2. create ssh keys
   ssh-keygen -t ed25519 -C "Desktop ssh key"
  ssh-copy-id -i $HOME/.ssh/id_ed25519.pub dyu@192.168.128.138
3. Create a an ansible inventory file. i.e. hosts
   [local]
127.0.0.1 [remote] 192.168.1.2
4. basic commands
ansible -i ./hosts --connection=local local -m ping
ansible -i ./hosts remote -m ping
   ansible -i ./hosts local --connection=local  -m shell -a 'apt-get -y install nginx'

沒有留言:

張貼留言

 Python install twine on Mac 1. Need to install macports first, https://ports.macports.org/port/twine/  2.  sudo port install twine   Pychar...