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'
沒有留言:
張貼留言