playbook run on one host

ansible-playbook my-playbook.yml -i inventory_file --extra-vars "target=hostname" --check

vi my-playbook.yml

---
- hosts: '{{ target }}'
remote_user: root

tasks:

- name: Install http on remote server
yum: pkg=httpd state=latest

One thought on “playbook run on one host

Leave a Reply

Your email address will not be published. Required fields are marked *