From 5c69e3822efeafc41c1a2af30b65aceae0e50445 Mon Sep 17 00:00:00 2001 From: Jiri Tyr Date: Tue, 24 Jul 2018 19:01:02 +0100 Subject: [PATCH] Improving documentation for VM configuration --- README.md | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 37774fb..075548f 100644 --- a/README.md +++ b/README.md @@ -211,9 +211,6 @@ Examples tags: vmware_vm_provisioning when: > inventory_hostname == 'localhost' - -# We can import another playbook to configugure the VM right after it was provisioned -- import_playbook: site.yaml ``` In order to provision only certain VMs, you can use the following approach: @@ -232,6 +229,20 @@ ansible-playbook \ vm_provisioning.yaml ``` +We can also use execute Ansible with multiple playbooks to configure the VM +right after it was provisioned: + +```shell +ansible-playbook \ + -i localhost, \ + -i hosts \ + -l '~(localhost|test0[13])' \ + -e '{ vmware_vm_provisioning_limit: "{{ ansible_play_hosts }}" }' \ + vm_provisioning.yaml \ + # That's the second playbook which configures the provisioned VM(s) + site.yaml +``` + Role variables --------------