Control node: macOS latop, homebrew, python3.8 Install ansible:
$ python3 -m venv .venv
$ source .venv/bin/activate
$ pip install ansible ansible-lint
Setup a host Inventory: inventory.yml
all:
hosts:
hanalei:
ansible_port: 22
ansible_user: ubuntu
ansible_host: XXX.XXX.XXX.XXX
ansible_ssh_private_key_file: foo.pem
$ ansible -i inventory.yml all -a "/bin/echo hello"
hanalei | CHANGED | rc=0 >>
hello
$ ansible -i inventory.yml all -m setup
... <cool stuff>
Lint the playbooks:
$ ansible-lint provision.yml
$ ansible-playbook -i inventory.yml provision.yml
...
or just run tasks with a tag:
$ ansible-playbook -i inventory.yml --tags basic provision.yml