{"id":1359,"date":"2021-05-26T17:18:03","date_gmt":"2021-05-26T17:18:03","guid":{"rendered":"https:\/\/www.nicktailor.com\/?p=1359"},"modified":"2021-05-27T07:17:26","modified_gmt":"2021-05-27T07:17:26","slug":"how-to-add-vm-tags-and-custom-attributes-with-anisblevmware","status":"publish","type":"post","link":"https:\/\/nicktailor.com\/tech-blog\/how-to-add-vm-tags-and-custom-attributes-with-anisblevmware\/","title":{"rendered":"How to add VM-Tags and Custom attributes with Anisble(VMware)"},"content":{"rendered":"<p style=\"margin-top: 0pt; padding-top: 0; margin-bottom: 8pt; padding-bottom: 0; line-height: 1.3;\"><strong>So whether your using cloud or doing in house deploys. Tagging is a used a lot especially in cloud type environments. Which we will cover in later posts. <\/strong><\/p>\n<p style=\"margin-top: 0pt; padding-top: 0; margin-bottom: 8pt; padding-bottom: 0; line-height: 1.3;\"><strong>So a common reason to tag your vm is wanting to have the creation date and the type of server or environment its using, handy for backup solutions &amp; other auditables.<\/strong><\/p>\n<p style=\"margin-top: 0pt; padding-top: 0; margin-bottom: 8pt; padding-bottom: 0; line-height: 1.3;\"><span style=\"display: inline-block; height: 1em;\"><span style=\"display: none;\">.<\/span><\/span><\/p>\n<p style=\"margin-top: 0pt; padding-top: 0; margin-bottom: 8pt; padding-bottom: 0; line-height: 1.3;\"><strong>Pre-requisites: Assumed.<\/strong><\/p>\n<div class=\"ul\" style=\"margin: 0;\">\n<div class=\"li\" style=\"margin: 0;\">\n<div style=\"margin-top: 0pt; padding-top: 0; margin-bottom: 0; padding-bottom: 0; line-height: 1.3; margin-left: 72pt;\"><span style=\"display: inline-block; position: relative; text-indent: -18pt; font-weight: bold; color: #c00000;\"><span style=\"position: absolute; top: -0.34em; left: 0; font-size: 2em;\">\u2022<\/span>\u00a0<\/span><strong><span style=\"color: #c00000;\">Ansible 2.9 installed and configured \u2013<\/span><\/strong><\/div>\n<\/div>\n<div class=\"li\" style=\"margin: 0;\">\n<div style=\"margin-bottom: 0; padding-bottom: 0; line-height: 1.3; margin-left: 72pt;\"><span style=\"display: inline-block; position: relative; text-indent: -18pt; font-weight: bold; color: #c00000;\"><span style=\"position: absolute; top: -0.34em; left: 0; font-size: 2em;\">\u2022<\/span>\u00a0<\/span><strong><span style=\"color: #c00000;\">Vmware<\/span><span style=\"color: #c00000;\"> Community modules configured<\/span><\/strong><\/div>\n<\/div>\n<div class=\"li\" style=\"margin: 0;\">\n<div style=\"margin-bottom: 0; padding-bottom: 0; line-height: 1.3; margin-left: 72pt;\"><span style=\"display: inline-block; position: relative; text-indent: -18pt; font-weight: bold; color: #c00000;\"><span style=\"position: absolute; top: -0.34em; left: 0; font-size: 2em;\">\u2022<\/span>\u00a0<\/span><strong><span style=\"color: #c00000;\">Vmware<\/span><span style=\"color: #c00000;\"> group variables previously defined for <\/span><span style=\"color: #c00000;\">vmware<\/span><span style=\"color: #c00000;\"> deployments(Is helpful)<\/span><\/strong><\/div>\n<p style=\"text-align: left; margin-bottom: 8pt; padding-bottom: 0; line-height: 1.3; margin-left: 72pt;\"><span style=\"display: inline-block; height: 1em;\"><span style=\"display: none;\">.<\/span><\/span><\/p>\n<\/div>\n<\/div>\n<p style=\"margin-top: 0pt; padding-top: 0; margin-bottom: 8pt; padding-bottom: 0; line-height: 1.3;\"><strong>Step by Step:<\/strong><\/p>\n<div class=\"ol\" style=\"margin: 0;\">\n<div class=\"li\" style=\"margin: 0;\">\n<div style=\"margin-top: 0pt; padding-top: 0; margin-bottom: 0; padding-bottom: 0; line-height: 1.3; margin-left: 36pt;\">\n<p><span style=\"display: inline-block; position: relative; text-indent: -18pt; font-weight: bold;\">1.<\/span><strong>Create a roles directory inside \/etc\/ansible\/roles<\/strong><\/p>\n<\/div>\n<div class=\"ol\" style=\"margin: 0;\">\n<div class=\"li\" style=\"margin: 0;\">\n<div style=\"margin-bottom: 0; padding-bottom: 0; line-height: 1.3; margin-left: 72pt;\"><span style=\"display: inline-block; position: relative; text-indent: -18pt; font-style: italic; font-weight: bold; color: #000000;\">a.<\/span><strong><em>mkdir -p \/etc\/ansible\/roles\/custom-tags-attributes-vmware\/tasks<\/em><\/strong><\/div>\n<\/div>\n<div class=\"li\" style=\"margin: 0;\">\n<div style=\"margin-bottom: 0; padding-bottom: 0; line-height: 1.3; margin-left: 72pt;\">\n<p><span style=\"display: inline-block; position: relative; text-indent: -18pt; font-style: italic; font-weight: bold; color: #000000;\">b.<\/span><strong><em>mkdir -p \/etc\/ansible\/roles\/ custom-tags-attributes-vmware\/defaults<\/em><\/strong><\/p>\n<p>&nbsp;<\/p>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"li\" style=\"margin: 0;\">\n<div style=\"margin-bottom: 0; padding-bottom: 0; line-height: 1.3; margin-left: 36pt;\">\n<p><span style=\"display: inline-block; position: relative; text-indent: -18pt; font-weight: bold;\">2.<\/span><strong>Now you want to create a task for the snapshots.<\/strong><\/p>\n<\/div>\n<div class=\"ol\" style=\"margin: 0;\">\n<div class=\"li\" style=\"margin: 0;\">\n<div style=\"margin-bottom: 0; padding-bottom: 0; line-height: 1.3; margin-left: 72pt;\"><span style=\"display: inline-block; position: relative; text-indent: -18pt; font-style: italic; font-weight: bold; color: #000000;\">c.<\/span><strong><em>Inside \/etc\/ansible\/roles\/custom-tags-attributes-vmware\/tasks\/<\/em><\/strong><\/div>\n<\/div>\n<div class=\"li\" style=\"margin: 0;\">\n<div style=\"margin-bottom: 0; padding-bottom: 0; line-height: 1.3; margin-left: 72pt;\">\n<p><span style=\"display: inline-block; position: relative; text-indent: -18pt; font-style: italic; font-weight: bold; color: #000000;\">d.<\/span><strong><em>Create a file called main.yml<\/em><\/strong><\/p>\n<p>&nbsp;<\/p>\n<\/div>\n<div><\/div>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"li\" style=\"margin: 0;\">\n<div style=\"margin-bottom: 8pt; padding-bottom: 0; line-height: 1.3; margin-left: 36pt;\"><span style=\"display: inline-block; position: relative; text-indent: -18pt; font-weight: bold;\">3.<\/span><strong>Add the following code and save the file<\/strong><strong>\u00a0<\/strong><\/div>\n<div><\/div>\n<\/div>\n<\/div>\n<p style=\"margin-top: 0pt; padding-top: 0; margin-bottom: 8pt; padding-bottom: 0; line-height: 1.3;\"><strong><span style=\"color: #7030a0;\">Note: Okay for the custom attributes to work you need to get the <\/span><span style=\"color: #00b0f0;\">MOID, <\/span><span style=\"color: #00b0f0;\">UUID<\/span><span style=\"color: #00b0f0;\"> &amp; Folder<\/span> <span style=\"color: #7030a0;\">of the <\/span><span style=\"color: #7030a0;\">vm<\/span><span style=\"color: #7030a0;\"> by using the <\/span><span style=\"color: #7030a0;\">vm<\/span><span style=\"color: #7030a0;\"> name.<\/span><span style=\"color: #7030a0;\"> So we need to gather facts about the <\/span><span style=\"color: #7030a0;\">vm<\/span><span style=\"color: #7030a0;\"> and the set those facts as variables that we can pass to the next tasks.<\/span><\/strong><\/p>\n<p>&nbsp;<\/p>\n<h2 style=\"margin-top: 2pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.3; color: #2f5496; font-size: 13pt;\">&#8211; name: get list of facts<\/h2>\n<h2 style=\"margin-top: 2pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.3; color: #2f5496; font-size: 13pt;\">\u00a0\u00a0vmware_guest_facts:<\/h2>\n<h2 style=\"margin-top: 2pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.3; color: #2f5496; font-size: 13pt;\">hostname: &#8220;{{ vcenter_host }}&#8221;<\/h2>\n<h2 style=\"margin-top: 2pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.3; color: #2f5496; font-size: 13pt;\">username: &#8220;{{ vcenter_username }}&#8221;<\/h2>\n<h2 style=\"margin-top: 2pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.3; color: #2f5496; font-size: 13pt;\">password: &#8220;{{ vcenter_password }}&#8221;<\/h2>\n<h2 style=\"margin-top: 2pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.3; color: #2f5496; font-size: 13pt;\">name: &#8220;{{ inventory_hostname }}&#8221;<\/h2>\n<h2 style=\"margin-top: 2pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.3; color: #2f5496; font-size: 13pt;\">\u00a0\u00a0\u00a0\u00a0datacenter: &#8220;{{ vcenter_dc }}&#8221;<\/h2>\n<h2 style=\"margin-top: 2pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.3; color: #2f5496; font-size: 13pt;\">\u00a0\u00a0\u00a0\u00a0validate_certs: False<\/h2>\n<h2 style=\"margin-top: 2pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.3; color: #2f5496; font-size: 13pt;\">\u00a0\u00a0delegate_to: localhost<\/h2>\n<h2 style=\"margin-top: 2pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.3; color: #2f5496; font-size: 13pt;\">\u00a0\u00a0ignore_errors: true<\/h2>\n<h2 style=\"margin-top: 2pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.3; color: #2f5496; font-size: 13pt;\"><strong> register: vm_facts<\/strong><\/h2>\n<p>&nbsp;<\/p>\n<p><strong><span style=\"color: #7030a0;\"><em>Note: So when we use the <\/em><\/span><span style=\"color: #7030a0;\"><em>vmware_guest_facts<\/em><\/span><span style=\"color: #7030a0;\"><em> module to gather the facts about the <\/em><\/span><span style=\"color: #7030a0;\"><em>v<\/em><\/span><span style=\"color: #7030a0;\"><em>m<\/em><\/span><span style=\"color: #7030a0;\"><em> by register the facts to a variable \u201c<\/em><\/span><span style=\"color: #7030a0;\"><em>vm_facts<\/em><\/span><span style=\"color: #7030a0;\"><em>\u201d<\/em><\/span><span style=\"color: #7030a0;\"><em>, which when you run the playbook with &#8211;<\/em><\/span><span style=\"color: #7030a0;\"><em>vvvv<\/em><\/span><span style=\"color: #7030a0;\"><em> will spit out the <\/em><\/span><span style=\"color: #7030a0;\"><em>facst<\/em><\/span><span style=\"color: #7030a0;\"><em> you can pass as indicated below.<\/em><\/span><\/strong><span style=\"display: inline-block; height: 1em;\"><span style=\"display: none;\">.<\/span><\/span><\/p>\n<p style=\"margin-top: 0pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.2;\"><strong><span style=\"color: #0070c0;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/span><span style=\"color: #0070c0;\"> &#8220;<\/span><span style=\"color: #0070c0;\">hw_folder<\/span><span style=\"color: #0070c0;\">&#8220;: &#8220;\/<\/span><span style=\"color: #0070c0;\">SysUnix<\/span><span style=\"color: #0070c0;\">\/Test<\/span><span style=\"color: #0070c0;\">ing<\/span><span style=\"color: #0070c0;\">&#8220;,<\/span><\/strong><\/p>\n<p style=\"margin-top: 0pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.2;\"><span style=\"color: #0070c0;\"> &#8220;<\/span><span style=\"color: #0070c0;\">hw_guest_full_name<\/span><span style=\"color: #0070c0;\">&#8220;: &#8220;Red Hat Enterprise Linux 7 (64-bit)&#8221;,<\/span><\/p>\n<p style=\"margin-top: 0pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.2;\"><span style=\"color: #0070c0;\"> &#8220;<\/span><span style=\"color: #0070c0;\">hw_guest_ha_state<\/span><span style=\"color: #0070c0;\">&#8220;: true,<\/span><\/p>\n<p style=\"margin-top: 0pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.2;\"><span style=\"color: #0070c0;\"> &#8220;<\/span><span style=\"color: #0070c0;\">hw_guest_id<\/span><span style=\"color: #0070c0;\">&#8220;: &#8220;rhel7_64Guest&#8221;,<\/span><\/p>\n<p style=\"margin-top: 0pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.2;\"><span style=\"color: #0070c0;\"> &#8220;<\/span><span style=\"color: #0070c0;\">hw_interfaces<\/span><span style=\"color: #0070c0;\">&#8220;: [<\/span><\/p>\n<p style=\"margin-top: 0pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.2;\"><span style=\"color: #0070c0;\"> &#8220;eth0&#8221;<\/span><\/p>\n<p style=\"margin-top: 0pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.2;\"><span style=\"color: #0070c0;\"> ],<\/span><\/p>\n<p style=\"margin-top: 0pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.2;\"><span style=\"color: #0070c0;\"> &#8220;<\/span><span style=\"color: #0070c0;\">hw_is_template<\/span><span style=\"color: #0070c0;\">&#8220;: false,<\/span><\/p>\n<p style=\"margin-top: 0pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.2;\"><span style=\"color: #0070c0;\"> &#8220;<\/span><span style=\"color: #0070c0;\">hw_memtotal_mb<\/span><span style=\"color: #0070c0;\">&#8220;: 2048,<\/span><\/p>\n<p style=\"margin-top: 0pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.2;\"><span style=\"color: #0070c0;\"> &#8220;<\/span><span style=\"color: #0070c0;\">hw_name<\/span><span style=\"color: #0070c0;\">&#8220;: &#8220;v-sits-test4&#8221;,<\/span><\/p>\n<p style=\"margin-top: 0pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.2;\"><span style=\"color: #0070c0;\"> &#8220;<\/span><span style=\"color: #0070c0;\">hw_power_status<\/span><span style=\"color: #0070c0;\">&#8220;: &#8220;<\/span><span style=\"color: #0070c0;\">poweredOn<\/span><span style=\"color: #0070c0;\">&#8220;,<\/span><\/p>\n<p style=\"margin-top: 0pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.2;\"><span style=\"color: #0070c0;\"> &#8220;<\/span><span style=\"color: #0070c0;\">hw_processor_count<\/span><span style=\"color: #0070c0;\">&#8220;: 2,<\/span><\/p>\n<p style=\"margin-top: 0pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.2;\"><span style=\"color: #0070c0;\"> &#8220;<\/span><span style=\"color: #0070c0;\">hw_product_uuid<\/span><span style=\"color: #0070c0;\">&#8220;: &#8220;4226d4e1-6be8-9447-5ced-b037075e2ffd&#8221;,<\/span><\/p>\n<p style=\"margin-top: 0pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.2;\"><span style=\"color: #0070c0;\"> &#8220;<\/span><span style=\"color: #0070c0;\">hw_version<\/span><span style=\"color: #0070c0;\">&#8220;: &#8220;vmx-11&#8221;,<\/span><\/p>\n<p style=\"margin-top: 0pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.2;\"><strong><span style=\"color: #0070c0;\"> &#8220;<\/span><span style=\"color: #0070c0;\">instance_uuid<\/span><span style=\"color: #0070c0;\">&#8220;: &#8220;50263518-c95b-c3be-5c77-4e1ea69ec295&#8221;,<\/span><\/strong><\/p>\n<p style=\"margin-top: 0pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.2;\"><span style=\"color: #0070c0;\"> &#8220;ipv4&#8221;: &#8220;1<\/span><span style=\"color: #0070c0;\">92.168.1.29<\/span><span style=\"color: #0070c0;\">&#8220;,<\/span><\/p>\n<p style=\"margin-top: 0pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.2;\"><span style=\"color: #0070c0;\"> &#8220;ipv6&#8221;: null,<\/span><\/p>\n<p style=\"margin-top: 0pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.2;\"><span style=\"color: #0070c0;\"> &#8220;<\/span><span style=\"color: #0070c0;\">module_hw<\/span><span style=\"color: #0070c0;\">&#8220;: true,<\/span><\/p>\n<p style=\"margin-top: 0pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.2;\"><span style=\"color: #0070c0;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/span><strong><span style=\"color: #0070c0;\">&#8220;<\/span><span style=\"color: #0070c0;\">moid<\/span><span style=\"color: #0070c0;\">&#8220;: &#8220;vm-296678&#8221;,<\/span><\/strong><\/p>\n<p style=\"margin-top: 0pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.2;\"><span style=\"color: #0070c0;\"> &#8220;snapshots&#8221;: [],<\/span><\/p>\n<p style=\"margin-top: 0pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.2;\"><span style=\"color: #0070c0;\"> &#8220;<\/span><span style=\"color: #0070c0;\">vimref<\/span><span style=\"color: #0070c0;\">&#8220;: &#8220;vim.VirtualMachine:vm-296678&#8221;,<\/span><\/p>\n<p style=\"margin-top: 0pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.2;\"><span style=\"color: #0070c0;\"> &#8220;<\/span><span style=\"color: #0070c0;\">vnc<\/span><span style=\"color: #0070c0;\">&#8220;: {}<\/span><\/p>\n<p style=\"margin-top: 0pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.2;\"><span style=\"display: inline-block; height: 1em;\"><span style=\"display: none;\">.<\/span><\/span><\/p>\n<p style=\"margin-top: 0pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.2;\"><span style=\"display: inline-block; height: 1em;\"><span style=\"display: none;\">.<\/span><\/span><strong><span style=\"color: #7030a0;\"><em>Note: Now that we have the <\/em><\/span><span style=\"color: #00b0f0;\"><em>UUID<\/em><\/span><span style=\"color: #00b0f0;\"><em>, MOID, &amp; Folder. <\/em><\/span><span style=\"color: #7030a0;\"><em>We now want to create static variables for UUID, MOID, &amp; folder by using the previous variable we registered as \u201c<\/em><\/span><span style=\"color: #7030a0;\"><em>vm_facts<\/em><\/span><span style=\"color: #7030a0;\"><em>\u201d, and we want to set them as static variables by setting them as facts we can past to the tasks after. As indicated below. Again setting facts is the same as defining variables in bash. Just ansible way to do it.<\/em><\/span><\/strong><\/p>\n<p>&nbsp;<\/p>\n<h2 style=\"margin-top: 2pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.3; color: #2f5496; font-size: 13pt;\"><strong>&#8211; set_fact:<\/strong><\/h2>\n<h2 style=\"margin-top: 2pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.3; color: #2f5496; font-size: 13pt;\"><strong>\u00a0\u00a0\u00a0\u00a0vm_uuid: &#8220;{{ vm_facts.instance.instance_uuid }}&#8221;<\/strong><\/h2>\n<h2 style=\"margin-top: 2pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.3; color: #2f5496; font-size: 13pt;\"><strong>&#8211; set_fact:<\/strong><\/h2>\n<h2 style=\"margin-top: 2pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.3; color: #2f5496; font-size: 13pt;\"><strong>\u00a0\u00a0\u00a0\u00a0moid: &#8220;{{ vm_facts.instance.moid }}&#8221;<\/strong><\/h2>\n<h2 style=\"margin-top: 2pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.3; color: #2f5496; font-size: 13pt;\"><strong>&#8211; set_fact:<\/strong><\/h2>\n<h2 style=\"margin-top: 2pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.3; color: #2f5496; font-size: 13pt;\"><strong>\u00a0\u00a0\u00a0\u00a0vm_folder: &#8220;{{ vm_facts.instance.hw_folder }}&#8221;<\/strong><\/h2>\n<p>&nbsp;<\/p>\n<p style=\"margin-top: 0pt; padding-top: 0; margin-bottom: 8pt; padding-bottom: 0; line-height: 1.3;\"><strong><span style=\"color: #7030a0;\"><em>Note<\/em><\/span><em>: <\/em><span style=\"color: #7030a0;\"><em>Now want to use the ansible server date and pass that as a variable so you don\u2019t have to input the date as manual value each time you deploy a new host. So we want to grab the date and setup a static fact and then pass it as its own variable. Like we did above\u2026<\/em><\/span><\/strong><\/p>\n<h2 style=\"margin-top: 2pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.3; color: #2f5496; font-size: 13pt;\">&#8211; name: Get Date<\/h2>\n<h2 style=\"margin-top: 2pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.3; color: #2f5496; font-size: 13pt;\">shell: date +%Y-%m-%d<\/h2>\n<h2 style=\"margin-top: 2pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.3; color: #2f5496; font-size: 13pt;\"><strong> register: date<\/strong><\/h2>\n<h2 style=\"margin-top: 2pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.3; color: #2f5496; font-size: 13pt;\">\u00a0\u00a0delegate_to: localhost<\/h2>\n<p>&nbsp;<\/p>\n<p style=\"margin-top: 0pt; padding-top: 0; margin-bottom: 8pt; padding-bottom: 0; line-height: 1.3;\"><strong><span style=\"color: #7030a0;\"><em>Note: We use shell module to get the date in the format we want, then register the result as the variable {{ date }}. We then set a static fact of the result and create another variable called date with using the result from the above.<\/em><\/span><\/strong><\/p>\n<h2 style=\"margin-top: 2pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.3; color: #2f5496; font-size: 13pt;\"><strong>&#8211; set_fact:<\/strong><\/h2>\n<h2 style=\"margin-top: 2pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.3; color: #2f5496; font-size: 13pt;\">\u00a0\u00a0\u00a0\u00a0<strong>date: &#8220;{{ date.stdout }}&#8221;<\/strong><\/h2>\n<p>&nbsp;<\/p>\n<p style=\"margin-top: 0pt; padding-top: 0; margin-bottom: 8pt; padding-bottom: 0; line-height: 1.3;\"><strong><span style=\"color: #7030a0;\"><em>Note: We now want to pass all the fact to the \u201c<\/em><\/span><span style=\"color: #00b0f0;\"><em>vmware_guest_custom_attributes<\/em><\/span><em>\u201d <\/em><span style=\"color: #7030a0;\"><em>module <\/em><\/span><span style=\"color: #00b0f0;\"><em>UUID<\/em><\/span><span style=\"color: #7030a0;\"><em>, <\/em><\/span><span style=\"color: #00b0f0;\"><em>MOID<\/em><\/span><span style=\"color: #7030a0;\"><em>, <\/em><\/span><span style=\"color: #00b0f0;\"><em>DATE<\/em><\/span><span style=\"color: #7030a0;\"><em>, and <\/em><\/span><span style=\"color: #00b0f0;\"><em>Folder <\/em><\/span><span style=\"color: #7030a0;\"><em>indicated as below.<\/em><\/span><\/strong><\/p>\n<h2 style=\"margin-top: 2pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.3; color: #2f5496; font-size: 13pt;\">&#8211; name: Add multiple virtual machine custom attributes<\/h2>\n<h2 style=\"margin-top: 2pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.3; color: #2f5496; font-size: 13pt;\">\u00a0\u00a0vmware_guest_custom_attributes:<\/h2>\n<h2 style=\"margin-top: 2pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.3; color: #2f5496; font-size: 13pt;\">hostname: &#8220;{{ vcenter_host }}&#8221;<\/h2>\n<h2 style=\"margin-top: 2pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.3; color: #2f5496; font-size: 13pt;\">username: &#8220;{{ vcenter_username }}&#8221;<\/h2>\n<h2 style=\"margin-top: 2pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.3; color: #2f5496; font-size: 13pt;\">password: &#8220;{{ vcenter_password }}&#8221;<\/h2>\n<h2 style=\"margin-top: 2pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.3; color: #2f5496; font-size: 13pt;\">name: &#8220;{{ inventory_hostname }}&#8221;<\/h2>\n<h2 style=\"margin-top: 2pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.3; color: #2f5496; font-size: 13pt;\">\u00a0\u00a0\u00a0\u00a0datacenter: &#8220;{{ vcenter_dc }}&#8221;<\/h2>\n<h2 style=\"margin-top: 2pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.3; color: #2f5496; font-size: 13pt;\">\u00a0\u00a0\u00a0<strong> folder: &#8220;{{ vm_folder }}&#8221;<\/strong><\/h2>\n<h2 style=\"margin-top: 2pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.3; color: #2f5496; font-size: 13pt;\">\u00a0\u00a0\u00a0\u00a0<strong>uuid: &#8220;{{ vm_facts.instance.instance_uuid }}&#8221;<\/strong><\/h2>\n<h2 style=\"margin-top: 2pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.3; color: #2f5496; font-size: 13pt;\"><strong>\u00a0\u00a0\u00a0\u00a0moid: &#8220;{{ vm_facts.instance.moid }}&#8221;<\/strong><\/h2>\n<h2 style=\"margin-top: 2pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.3; color: #2f5496; font-size: 13pt;\">state: present<\/h2>\n<h2 style=\"margin-top: 2pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.3; color: #2f5496; font-size: 13pt;\">\u00a0\u00a0\u00a0\u00a0validate_certs: False<\/h2>\n<h2 style=\"margin-top: 2pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.3; color: #2f5496; font-size: 13pt;\">\u00a0\u00a0\u00a0\u00a0use_instance_uuid: True<\/h2>\n<h2 style=\"margin-top: 2pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.3; color: #2f5496; font-size: 13pt;\">attributes:<\/h2>\n<h2 style=\"margin-top: 2pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.3; color: #2f5496; font-size: 13pt;\">&#8211; name: Creation Date<\/h2>\n<h2 style=\"margin-top: 2pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.3; color: #2f5496; font-size: 13pt;\"><strong> value: &#8220;{{ date }}&#8221;\u00a0\u00a0\u00a0<\/strong><\/h2>\n<h2 style=\"margin-top: 2pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.3; color: #2f5496; font-size: 13pt;\"># &#8211; name: MyAttribute2 &#8211; <strong><span style=\"color: #7030a0;\">Note: You can add additional attributes if you wish<\/span><\/strong><\/h2>\n<h2 style=\"margin-top: 2pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.3; color: #2f5496; font-size: 13pt;\"># value: test2 &#8211; <strong><span style=\"color: #7030a0;\">Note: You can add additional attributes if you wish<\/span><\/strong><\/h2>\n<h2 style=\"margin-top: 2pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.3; color: #2f5496; font-size: 13pt;\">\u00a0\u00a0delegate_to: localhost<\/h2>\n<h2 style=\"margin-top: 2pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.3; color: #2f5496; font-size: 13pt;\">register: attributes<\/h2>\n<p>&nbsp;<\/p>\n<h2 style=\"margin-top: 2pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.3; color: #2f5496; font-size: 13pt;\"><strong><span style=\"color: #7030a0;\"><em>Note: Okay so depending on which module you use, some require you to gather facts about the <\/em><\/span><span style=\"color: #7030a0;\"><em>vmware<\/em><\/span><span style=\"color: #7030a0;\"><em> categories. This is <\/em><\/span><span style=\"color: #7030a0;\"><em>just <\/em><\/span><span style=\"color: #7030a0;\"><em>incase<\/em><\/span> <span style=\"color: #7030a0;\"><em>you need the <\/em><\/span><span style=\"color: #7030a0;\"><em>cateogory_id<\/em><\/span><span style=\"color: #7030a0;\"><em> which is usually <\/em><\/span><span style=\"color: #7030a0;\"><em>derived<\/em><\/span><span style=\"color: #7030a0;\"><em> from using a REST API in json or other method. The \u201c<\/em><\/span><span style=\"color: #00b0f0;\"><em>community.vmware.vmware_category_facts<\/em><\/span><em>\u201d<\/em><span style=\"color: #7030a0;\"><em>will<\/em><\/span><span style=\"color: #7030a0;\"><em> be able to pull the info and then you can pass it <\/em><\/span><span style=\"color: #7030a0;\"><em>as a variable or a static value<\/em><\/span><span style=\"color: #7030a0;\"><em>. IF YOU NEED, however this is NOT needed. If you use the <\/em><\/span><span style=\"color: #00b0f0;\"><em>\u201c<\/em><\/span><span style=\"color: #00b0f0;\"><em>vmware_tag_manager<\/em><\/span><span style=\"color: #00b0f0;\"><em>\u201d module&#8221;<br \/>\n<\/em><\/span><\/strong><\/h2>\n<p><strong><span style=\"color: #00b0f0;\"><em>\u00a0<\/em><\/span><\/strong><\/p>\n<h2 style=\"margin-top: 2pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.3; color: #2f5496; font-size: 13pt;\"><strong><span style=\"color: #c00000;\">&#8211; name: Gather facts about tag categories<\/span><\/strong><\/h2>\n<h2 style=\"margin-top: 2pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.3; color: #2f5496; font-size: 13pt;\"><strong><span style=\"color: #c00000;\">\u00a0\u00a0<\/span><span style=\"color: #c00000;\">community.vmware.vmware_category_facts<\/span><span style=\"color: #c00000;\">:<\/span><\/strong><\/h2>\n<h2 style=\"margin-top: 2pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.3; color: #2f5496; font-size: 13pt;\"><strong><span style=\"color: #c00000;\"> hostname: &#8220;{{ <\/span><span style=\"color: #c00000;\">vcenter_host<\/span><span style=\"color: #c00000;\"> }}&#8221;<\/span><\/strong><\/h2>\n<h2 style=\"margin-top: 2pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.3; color: #2f5496; font-size: 13pt;\"><strong><span style=\"color: #c00000;\"> username: &#8220;{{ <\/span><span style=\"color: #c00000;\">vcenter_username<\/span><span style=\"color: #c00000;\"> }}&#8221;<\/span><\/strong><\/h2>\n<h2 style=\"margin-top: 2pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.3; color: #2f5496; font-size: 13pt;\"><strong><span style=\"color: #c00000;\"> password: &#8220;{{ <\/span><span style=\"color: #c00000;\">vcenter_password<\/span><span style=\"color: #c00000;\"> }}&#8221;<\/span><\/strong><\/h2>\n<h2 style=\"margin-top: 2pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.3; color: #2f5496; font-size: 13pt;\"><strong><span style=\"color: #c00000;\">\u00a0\u00a0\u00a0\u00a0<\/span><span style=\"color: #c00000;\">validate_certs<\/span><span style=\"color: #c00000;\">: no<\/span><\/strong><\/h2>\n<h2 style=\"margin-top: 2pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.3; color: #2f5496; font-size: 13pt;\"><strong><span style=\"color: #c00000;\">\u00a0\u00a0<\/span><span style=\"color: #c00000;\">delegate_to<\/span><span style=\"color: #c00000;\">: localhost<\/span><\/strong><\/h2>\n<h2 style=\"margin-top: 2pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.3; color: #2f5496; font-size: 13pt;\"><strong><span style=\"color: #c00000;\"> register: <\/span><span style=\"color: #c00000;\">all_tag_category_facts<\/span><\/strong><\/h2>\n<p style=\"margin-top: 0pt; padding-top: 0; margin-bottom: 8pt; padding-bottom: 0; line-height: 1.3;\"><span style=\"display: inline-block; height: 1em;\"><span style=\"display: none;\">.<\/span><\/span><\/p>\n<p style=\"margin-top: 0pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.2;\"><span style=\"color: #0070c0;\">ok: [v-sits-test4] =&gt; {<\/span><\/p>\n<p style=\"margin-top: 0pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.2;\"><span style=\"color: #0070c0;\"> &#8220;changed&#8221;: false,<\/span><\/p>\n<p style=\"margin-top: 0pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.2;\"><span style=\"color: #0070c0;\"> &#8220;invocation&#8221;: {<\/span><\/p>\n<p style=\"margin-top: 0pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.2;\"><span style=\"color: #0070c0;\"> &#8220;<\/span><span style=\"color: #0070c0;\">module_args<\/span><span style=\"color: #0070c0;\">&#8220;: {<\/span><\/p>\n<p style=\"margin-top: 0pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.2;\"><span style=\"color: #0070c0;\"> &#8220;hostname&#8221;: &#8220;<\/span><span style=\"color: #0070c0;\">vmware.nicktailor.com<\/span><span style=\"color: #0070c0;\">&#8220;,<\/span><\/p>\n<p style=\"margin-top: 0pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.2;\"><span style=\"color: #0070c0;\"> &#8220;password&#8221;: &#8220;VALUE_SPECIFIED_IN_NO_LOG_PARAMETER&#8221;,<\/span><\/p>\n<p style=\"margin-top: 0pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.2;\"><span style=\"color: #0070c0;\"> &#8220;port&#8221;: 443,<\/span><\/p>\n<p style=\"margin-top: 0pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.2;\"><span style=\"color: #0070c0;\"> &#8220;protocol&#8221;: &#8220;https&#8221;,<\/span><\/p>\n<p style=\"margin-top: 0pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.2;\"><span style=\"color: #0070c0;\"> &#8220;username&#8221;: &#8220;<\/span><span style=\"color: #0070c0;\">admin<\/span><span style=\"color: #0070c0;\">&#8220;,<\/span><\/p>\n<p style=\"margin-top: 0pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.2;\"><span style=\"color: #0070c0;\"> &#8220;<\/span><span style=\"color: #0070c0;\">validate_certs<\/span><span style=\"color: #0070c0;\">&#8220;: false<\/span><\/p>\n<p style=\"margin-top: 0pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.2;\"><span style=\"color: #0070c0;\"> }<\/span><\/p>\n<p style=\"margin-top: 0pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.2;\"><span style=\"color: #0070c0;\"> },<\/span><\/p>\n<p style=\"margin-top: 0pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.2;\"><span style=\"color: #0070c0;\"> &#8220;<\/span><span style=\"color: #0070c0;\">tag_category_facts<\/span><span style=\"color: #0070c0;\">&#8220;: [<\/span><\/p>\n<p style=\"margin-top: 0pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.2;\"><span style=\"color: #0070c0;\"> {<\/span><\/p>\n<p style=\"margin-top: 0pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.2;\"><span style=\"color: #0070c0;\"> &#8220;<\/span><span style=\"color: #0070c0;\">category_associable_types<\/span><span style=\"color: #0070c0;\">&#8220;: [<\/span><\/p>\n<p style=\"margin-top: 0pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.2;\"><span style=\"color: #0070c0;\"> &#8220;<\/span><span style=\"color: #0070c0;\">VirtualMachine<\/span><span style=\"color: #0070c0;\">&#8220;<\/span><\/p>\n<p style=\"margin-top: 0pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.2;\"><span style=\"color: #0070c0;\"> ],<\/span><\/p>\n<p style=\"margin-top: 0pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.2;\"><span style=\"color: #0070c0;\"> &#8220;<\/span><span style=\"color: #0070c0;\">category_cardinality<\/span><span style=\"color: #0070c0;\">&#8220;: &#8220;SINGLE&#8221;,<\/span><\/p>\n<p style=\"margin-top: 0pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.2;\"><strong><span style=\"color: #0070c0;\">&#8220;<\/span><span style=\"color: #0070c0;\">category_description<\/span><span style=\"color: #0070c0;\">&#8220;: &#8220;VM Type &#8211; Clone, <\/span><span style=\"color: #0070c0;\">Decomm<\/span><span style=\"color: #0070c0;\">, Dev, Prod, SRM, SLM, Template or Test&#8221;,<\/span><\/strong><\/p>\n<p style=\"margin-top: 0pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.2;\"><strong><span style=\"color: #0070c0;\"> &#8220;<\/span><span style=\"color: #0070c0;\">category_id<\/span><span style=\"color: #0070c0;\">&#8220;: &#8220;urn:vmomi:InventoryServiceCategory:f10<\/span><span style=\"color: #0070c0;\">2<\/span><span style=\"color: #0070c0;\">4eb<\/span><span style=\"color: #0070c0;\">4<\/span><span style=\"color: #0070c0;\">-d7d<\/span><span style=\"color: #0070c0;\">4<\/span><span style=\"color: #0070c0;\">-49fe-9<\/span><span style=\"color: #0070c0;\">7<\/span><span style=\"color: #0070c0;\">25-4dcba39fbe<\/span><span style=\"color: #0070c0;\">3<\/span><span style=\"color: #0070c0;\">b:GLOBAL&#8221;,<\/span><\/strong><\/p>\n<p style=\"margin-top: 0pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.2;\"><span style=\"color: #0070c0;\"> &#8220;<\/span><span style=\"color: #0070c0;\">category_name<\/span><span style=\"color: #0070c0;\">&#8220;: &#8220;<\/span><span style=\"color: #0070c0;\">VMType<\/span><span style=\"color: #0070c0;\">&#8220;,<\/span><\/p>\n<p style=\"margin-top: 0pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.2;\"><span style=\"color: #0070c0;\"> &#8220;<\/span><span style=\"color: #0070c0;\">category_used_by<\/span><span style=\"color: #0070c0;\">&#8220;: []<\/span><\/p>\n<p style=\"margin-top: 0pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.2;\"><span style=\"color: #0070c0;\"> },<\/span><\/p>\n<p style=\"margin-top: 0pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.2;\"><span style=\"color: #0070c0;\"> {<\/span><\/p>\n<p style=\"margin-top: 0pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.2;\"><span style=\"color: #0070c0;\"> &#8220;<\/span><span style=\"color: #0070c0;\">category_associable_types<\/span><span style=\"color: #0070c0;\">&#8220;: [<\/span><\/p>\n<p style=\"margin-top: 0pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.2;\"><span style=\"color: #0070c0;\"> &#8220;<\/span><span style=\"color: #0070c0;\">VirtualMachine<\/span><span style=\"color: #0070c0;\">&#8220;<\/span><\/p>\n<p style=\"margin-top: 0pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.2;\"><span style=\"color: #0070c0;\"> ],<\/span><\/p>\n<p style=\"margin-top: 0pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.2;\"><span style=\"color: #0070c0;\"> &#8220;<\/span><span style=\"color: #0070c0;\">category_cardinality<\/span><span style=\"color: #0070c0;\">&#8220;: &#8220;SINGLE&#8221;,<\/span><\/p>\n<p style=\"margin-top: 0pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.2;\"><span style=\"color: #0070c0;\"> &#8220;<\/span><span style=\"color: #0070c0;\">category_description<\/span><span style=\"color: #0070c0;\">&#8220;: &#8220;Team or Department&#8221;,<\/span><\/p>\n<p style=\"margin-top: 0pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.2;\"><strong><span style=\"color: #0070c0;\"> &#8220;<\/span><span style=\"color: #0070c0;\">category_id<\/span><span style=\"color: #0070c0;\">&#8220;: &#8220;urn:vmomi:InventoryServiceCategory:<\/span><span style=\"color: #0070c0;\">88<\/span><span style=\"color: #0070c0;\">8a0877-<\/span><span style=\"color: #0070c0;\">5<\/span><span style=\"color: #0070c0;\">335-4<\/span><span style=\"color: #0070c0;\">4<\/span><span style=\"color: #0070c0;\">77-9347-6d8de5b3e<\/span><span style=\"color: #0070c0;\">60e<\/span><span style=\"color: #0070c0;\">:GLOBAL&#8221;,<\/span><\/strong><\/p>\n<p style=\"margin-top: 0pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.2;\"><span style=\"color: #0070c0;\"> &#8220;<\/span><span style=\"color: #0070c0;\">category_name<\/span><span style=\"color: #0070c0;\">&#8220;: &#8220;Team\/Dept&#8221;,<\/span><\/p>\n<p style=\"margin-top: 0pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.2;\"><span style=\"color: #0070c0;\"> &#8220;<\/span><span style=\"color: #0070c0;\">category_used_by<\/span><span style=\"color: #0070c0;\">&#8220;: []<\/span><\/p>\n<p style=\"margin-top: 0pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.2;\"><span style=\"color: #0070c0;\"> }<\/span><\/p>\n<p style=\"margin-top: 0pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.2;\"><span style=\"color: #0070c0;\"> ]<\/span><\/p>\n<p style=\"margin-top: 0pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.2;\"><span style=\"color: #0070c0;\">}<\/span><\/p>\n<p style=\"margin-top: 0pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.2;\"><span style=\"display: inline-block; height: 1em;\"><span style=\"display: none;\">.<\/span><\/span><\/p>\n<p style=\"margin-top: 0pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.2;\"><span style=\"display: inline-block; height: 1em;\"><span style=\"display: none;\">.<\/span><\/span><\/p>\n<h2 style=\"margin-top: 2pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.3; color: #2f5496; font-size: 13pt;\"><strong><span style=\"color: #7030a0;\"><em>Note: Now that we <\/em><\/span><span style=\"color: #7030a0;\"><em>want to create the tag for the <\/em><\/span><span style=\"color: #7030a0;\"><em>vm<\/em><\/span><span style=\"color: #7030a0;\"><em> using the \u201c<\/em><\/span><span style=\"color: #00b0f0;\"><em>\u201c<\/em><\/span><span style=\"color: #00b0f0;\"><em>vmware_tag_manager<\/em><\/span><span style=\"color: #00b0f0;\"><em>\u201d <\/em><\/span><span style=\"color: #7030a0;\"><em>module<\/em><\/span><span style=\"color: #7030a0;\"><em>. The only variable that is passed from outside the defaults at the <\/em><\/span><span style=\"color: #7030a0;\"><em>inventory_hostname<\/em><\/span><span style=\"color: #7030a0;\"><em> level \u201c<\/em><\/span><span style=\"color: #00b0f0;\"><em>host_var<\/em><\/span><span style=\"color: #00b0f0;\"><em>\/nicktest1\u201d<\/em><\/span><span style=\"color: #7030a0;\"><em> is the {{ <\/em><\/span><span style=\"color: #7030a0;\"><em>vm_tag<\/em><\/span><span style=\"color: #7030a0;\"><em> }} Make sure you have this defined for the role to work properly.<\/em><\/span><\/strong><\/h2>\n<p>&nbsp;<\/p>\n<h2 style=\"margin-top: 2pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.3; color: #2f5496; font-size: 13pt;\">&#8211; name: Add tags to a virtual machine<\/h2>\n<h2 style=\"margin-top: 2pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.3; color: #2f5496; font-size: 13pt;\">\u00a0\u00a0vmware_tag_manager:<\/h2>\n<h2 style=\"margin-top: 2pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.3; color: #2f5496; font-size: 13pt;\">hostname: &#8216;{{ vcenter_host }}&#8217;<\/h2>\n<h2 style=\"margin-top: 2pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.3; color: #2f5496; font-size: 13pt;\">username: &#8216;{{ vcenter_username }}&#8217;<\/h2>\n<h2 style=\"margin-top: 2pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.3; color: #2f5496; font-size: 13pt;\">password: &#8216;{{ vcenter_password }}&#8217;<\/h2>\n<h2 style=\"margin-top: 2pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.3; color: #2f5496; font-size: 13pt;\">\u00a0\u00a0\u00a0\u00a0validate_certs: no<\/h2>\n<h2 style=\"margin-top: 2pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.3; color: #2f5496; font-size: 13pt;\">\u00a0\u00a0\u00a0\u00a0tag_names:<\/h2>\n<h2 style=\"margin-top: 2pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.3; color: #2f5496; font-size: 13pt;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<strong>&#8211; &#8220;{{ vm_tag }}&#8221; \u2013 passed at the <span style=\"color: #00b0f0;\">host_var<\/span><span style=\"color: #00b0f0;\">\/nicktest1<\/span><\/strong><\/h2>\n<h2 style=\"margin-top: 2pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.3; color: #2f5496; font-size: 13pt;\">\u00a0\u00a0\u00a0\u00a0object_name: &#8220;{{ inventory_hostname }}&#8221;<\/h2>\n<h2 style=\"margin-top: 2pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.3; color: #2f5496; font-size: 13pt;\">\u00a0\u00a0\u00a0\u00a0object_type: VirtualMachine<\/h2>\n<h2 style=\"margin-top: 2pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.3; color: #2f5496; font-size: 13pt;\">state: present<\/h2>\n<h2 style=\"margin-top: 2pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.3; color: #2f5496; font-size: 13pt;\">\u00a0\u00a0delegate_to: localhost<\/h2>\n<p>&nbsp;<\/p>\n<div class=\"ol\" style=\"margin: 0;\">\n<div class=\"li\" style=\"margin: 0;\">\n<div style=\"margin-top: 0pt; padding-top: 0; margin-bottom: 0; padding-bottom: 0; line-height: 1.3; margin-left: 36pt;\"><span style=\"display: inline-block; position: relative; text-indent: -18pt; font-weight: bold;\">4.<\/span><strong>Save the file<\/strong><\/div>\n<\/div>\n<div class=\"li\" style=\"margin: 0;\">\n<div style=\"margin-bottom: 0; padding-bottom: 0; line-height: 1.3; margin-left: 36pt;\"><span style=\"display: inline-block; position: relative; text-indent: -18pt; font-weight: bold;\">5.<\/span><strong>You can either have <span style=\"color: #0070c0;\">group_vars<\/span> set up for individual datacenters, but for now just define the variables under <span style=\"color: #0070c0;\">\/etc\/ansible\/roles\/<\/span><span style=\"color: #0070c0;\">custom-tags-attributes-<\/span><span style=\"color: #0070c0;\">vmware<\/span><span style=\"color: #0070c0;\">\/defaults<\/span><\/strong><\/div>\n<p style=\"text-align: left; margin-bottom: 0; padding-bottom: 0; line-height: 1.3; margin-left: 36pt;\"><span style=\"display: inline-block; height: 1em;\"><span style=\"display: none;\">.<\/span><\/span><\/p>\n<p style=\"text-align: left; margin-bottom: 0; padding-bottom: 0; line-height: 1.3; margin-left: 36pt;\"><strong><span style=\"color: #7030a0;\"><em>Note: You will likely have a <\/em><\/span><span style=\"color: #7030a0;\"><em>group_var<\/em><\/span><span style=\"color: #7030a0;\"><em> from you <\/em><\/span><span style=\"color: #7030a0;\"><em>vmdeploy<\/em><\/span><span style=\"color: #7030a0;\"><em> role that you can use for here.<\/em><\/span><\/strong><\/p>\n<p style=\"text-align: left; margin-bottom: 0; padding-bottom: 0; line-height: 1.3; margin-left: 36pt;\"><span style=\"display: inline-block; height: 1em;\"><span style=\"display: none;\">.<\/span><\/span><\/p>\n<div class=\"ol\" style=\"margin: 0;\">\n<div class=\"li\" style=\"margin: 0;\">\n<div style=\"margin-bottom: 8pt; padding-bottom: 0; line-height: 1.3; margin-left: 72pt;\"><span style=\"display: inline-block; position: relative; text-indent: -18pt; font-weight: bold; color: #000000;\">e.<\/span><strong>Create a file called main.yml and the following variables<\/strong><\/div>\n<p style=\"text-align: left; margin-top: 0pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.2; margin-left: 108pt;\"><strong><span style=\"color: #0070c0;\">vcenter_username<\/span><span style=\"color: #0070c0;\">: admin<\/span><\/strong><\/p>\n<p style=\"text-align: left; margin-top: 0pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.2; margin-left: 108pt;\"><strong><span style=\"color: #0070c0;\">vcenter_password<\/span><span style=\"color: #0070c0;\">: should be vault encrypted variable<\/span><\/strong><\/p>\n<p style=\"text-align: left; margin-top: 0pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.2; margin-left: 108pt;\"><strong><span style=\"color: #0070c0;\">vcenter_host<\/span><span style=\"color: #0070c0;\">: vmware.nicktailor.com<\/span><\/strong><\/p>\n<p style=\"text-align: left; margin-top: 0pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.2; margin-left: 108pt;\"><strong><span style=\"color: #0070c0;\">vcenter_dc<\/span><span style=\"color: #0070c0;\">: London<\/span><\/strong><\/p>\n<p style=\"text-align: left; margin-top: 0pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.2; margin-left: 108pt;\"><span style=\"display: inline-block; height: 1em;\"><span style=\"display: none;\">.<\/span><\/span><\/p>\n<p style=\"text-align: left; margin-top: 0pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.2; margin-left: 108pt;\"><span style=\"display: inline-block; height: 1em;\"><span style=\"display: none;\">.<\/span><\/span><\/p>\n<\/div>\n<div class=\"li\" style=\"margin: 0;\">\n<div style=\"margin-top: 0pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.2; margin-left: 72pt;\"><span style=\"display: inline-block; position: relative; text-indent: -18pt; font-weight: bold; color: #000000;\">f.<\/span><strong><span style=\"color: #000000;\">Save the file<\/span><\/strong><\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<p style=\"margin-top: 0pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.2;\"><span style=\"display: inline-block; height: 1em;\"><span style=\"display: none;\">.<\/span><\/span><\/p>\n<div class=\"ul\" style=\"margin: 0;\">\n<div class=\"li\" style=\"margin: 0;\">\n<div style=\"margin-top: 0pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.2; margin-left: 54pt;\"><span style=\"display: inline-block; position: relative; text-indent: -18pt; font-weight: bold; color: #0070c0;\"><span style=\"position: absolute; top: -0.34em; left: 0; font-size: 2em;\">\u2022<\/span>\u00a0<\/span><strong><span style=\"color: #7030a0;\">Note: Ensure your host \u201cnicktest1\u201d is listed in your inventory host file. <\/span><\/strong><br \/>\n<strong><span style=\"color: #0070c0;\"><em>\/etc\/ansible\/inventory\/TEST\/hosts<\/em><\/span><\/strong><\/div>\n<\/div>\n<div class=\"li\" style=\"margin: 0;\">\n<div style=\"margin-top: 0pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.2; margin-left: 54pt;\"><span style=\"display: inline-block; position: relative; text-indent: -18pt; font-weight: bold; color: #0070c0;\"><span style=\"position: absolute; top: -0.34em; left: 0; font-size: 2em;\">\u2022<\/span>\u00a0<\/span><strong><span style=\"color: #7030a0;\">Note: Make sure your \u201c<\/span><span style=\"color: #7030a0;\"><span style=\"color: #00b0f0;\">host_var<\/span><span style=\"color: #00b0f0;\">\/nicktest1&#8243;\u00a0<\/span><\/span><span style=\"color: #7030a0;\">has the \u201c<span style=\"color: #7030a0;\">vm_tag<\/span><span style=\"color: #7030a0;\">: {{ value }}\u201d defined<\/span><\/span><\/strong><\/div>\n<div><\/div>\n<\/div>\n<\/div>\n<p>&nbsp;<\/p>\n<p style=\"margin-top: 0pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.2; margin-left: 18pt;\"><strong><span style=\"color: #000000;\">Run your playbook: from <\/span><span style=\"color: #7030a0;\">\/etc\/ansible<\/span><\/strong><\/p>\n<p style=\"margin-top: 0pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.2; margin-left: 18pt;\"><span style=\"display: inline-block; height: 1em;\"><span style=\"display: none;\">.<\/span><\/span><\/p>\n<div class=\"ol\" style=\"margin: 0;\">\n<div class=\"li\" style=\"margin: 0;\">\n<div style=\"margin-top: 0pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.2; margin-left: 36pt;\"><span style=\"display: inline-block; position: relative; text-indent: -18pt; font-weight: bold; color: #000000;\">1.<\/span><strong><span style=\"color: #7030a0;\">ansible-playbook &#8211;<\/span><span style=\"color: #7030a0;\">i<\/span><span style=\"color: #7030a0;\"> inventory\/TEST\/hosts <\/span><span style=\"color: #7030a0;\">justremovevmsnap.yml<\/span><span style=\"color: #7030a0;\"> &#8211;ask-vault-pass &#8211;limit=&#8217;nicktest1&#8242; <\/span><\/strong><\/div>\n<p style=\"text-align: left; margin-top: 0pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.2;\"><span style=\"display: inline-block; height: 1em;\"><span style=\"display: none;\">.<\/span><\/span><\/p>\n<p style=\"text-align: left; margin-top: 0pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.2;\"><strong><span style=\"color: #000000;\">Playbook log:<\/span><\/strong><\/p>\n<p style=\"text-align: left; margin-top: 0pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.2;\"><span style=\"display: inline-block; height: 1em;\"><span style=\"display: none;\">.<\/span><\/span><\/p>\n<p style=\"text-align: left; margin-top: 0pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.2;\"><strong><span style=\"color: #00b050;\">[root@ansible-server]# ansible-playbook &#8211;<\/span><span style=\"color: #00b050;\">i<\/span><span style=\"color: #00b050;\"> inventory\/TEST\/hosts <\/span><span style=\"color: #00b050;\">justcustomattrib.yml<\/span><span style=\"color: #00b050;\"> &#8211;ask-vault-pass &#8211;limit=&#8217;v-sits-test4&#8242;<\/span><\/strong><\/p>\n<p style=\"text-align: left; margin-top: 0pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.2;\"><strong><span style=\"color: #00b050;\">Vault password:<\/span><\/strong><\/p>\n<p style=\"text-align: left; margin-top: 0pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.2;\"><span style=\"display: inline-block; height: 1em;\"><span style=\"display: none;\">.<\/span><\/span><\/p>\n<p style=\"text-align: left; margin-top: 0pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.2;\"><strong><span style=\"color: #00b050;\">PLAY [all] **********************************************************************************************************************************<\/span><\/strong><\/p>\n<p style=\"text-align: left; margin-top: 0pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.2;\"><span style=\"display: inline-block; height: 1em;\"><span style=\"display: none;\">.<\/span><\/span><\/p>\n<p style=\"text-align: left; margin-top: 0pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.2;\"><strong><span style=\"color: #00b050;\">TASK [custom-tags-attributes-<\/span><span style=\"color: #00b050;\">vmware<\/span><span style=\"color: #00b050;\"> : get list of facts] ************************************************************************************<\/span><\/strong><\/p>\n<p style=\"text-align: left; margin-top: 0pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.2;\"><strong><span style=\"color: #00b050;\">[DEPRECATION WARNING]: The &#8216;<\/span><span style=\"color: #00b050;\">vmware_guest_facts<\/span><span style=\"color: #00b050;\">&#8216; module has been renamed to &#8216;<\/span><span style=\"color: #00b050;\">vmware_guest_info<\/span><span style=\"color: #00b050;\">&#8216;. This feature will be removed in version<\/span><\/strong><\/p>\n<p style=\"text-align: left; margin-top: 0pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.2;\"><strong><span style=\"color: #00b050;\">2.13. Deprecation warnings can be disabled by setting <\/span><span style=\"color: #00b050;\">deprecation_warnings<\/span><span style=\"color: #00b050;\">=False in <\/span><span style=\"color: #00b050;\">ansible.cfg<\/span><span style=\"color: #00b050;\">.<\/span><\/strong><\/p>\n<p style=\"text-align: left; margin-top: 0pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.2;\"><strong><span style=\"color: #00b050;\">ok: [v-sits-test4]<\/span><\/strong><\/p>\n<p style=\"text-align: left; margin-top: 0pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.2;\"><span style=\"display: inline-block; height: 1em;\"><span style=\"display: none;\">.<\/span><\/span><\/p>\n<p style=\"text-align: left; margin-top: 0pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.2;\"><strong><span style=\"color: #00b050;\">TASK [custom-tags-attributes-<\/span><span style=\"color: #00b050;\">vmware<\/span><span style=\"color: #00b050;\"> : <\/span><span style=\"color: #00b050;\">set_fact<\/span><span style=\"color: #00b050;\">] *********************************************************************************************<\/span><\/strong><\/p>\n<p style=\"text-align: left; margin-top: 0pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.2;\"><strong><span style=\"color: #00b050;\">ok: [v-sits-test4]<\/span><\/strong><\/p>\n<p style=\"text-align: left; margin-top: 0pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.2;\"><span style=\"display: inline-block; height: 1em;\"><span style=\"display: none;\">.<\/span><\/span><\/p>\n<p style=\"text-align: left; margin-top: 0pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.2;\"><strong><span style=\"color: #00b050;\">TASK [custom-tags-attributes-<\/span><span style=\"color: #00b050;\">vmware<\/span><span style=\"color: #00b050;\"> : <\/span><span style=\"color: #00b050;\">set_fact<\/span><span style=\"color: #00b050;\">] *********************************************************************************************<\/span><\/strong><\/p>\n<p style=\"text-align: left; margin-top: 0pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.2;\"><strong><span style=\"color: #00b050;\">ok: [v-sits-test4]<\/span><\/strong><\/p>\n<p style=\"text-align: left; margin-top: 0pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.2;\"><span style=\"display: inline-block; height: 1em;\"><span style=\"display: none;\">.<\/span><\/span><\/p>\n<p style=\"text-align: left; margin-top: 0pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.2;\"><strong><span style=\"color: #00b050;\">TASK [custom-tags-attributes-<\/span><span style=\"color: #00b050;\">vmware<\/span><span style=\"color: #00b050;\"> : <\/span><span style=\"color: #00b050;\">set_fact<\/span><span style=\"color: #00b050;\">] *********************************************************************************************<\/span><\/strong><\/p>\n<p style=\"text-align: left; margin-top: 0pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.2;\"><strong><span style=\"color: #00b050;\">ok: [v-sits-test4]<\/span><\/strong><\/p>\n<p style=\"text-align: left; margin-top: 0pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.2;\"><span style=\"display: inline-block; height: 1em;\"><span style=\"display: none;\">.<\/span><\/span><\/p>\n<p style=\"text-align: left; margin-top: 0pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.2;\"><strong><span style=\"color: #00b050;\">TASK [custom-tags-attributes-<\/span><span style=\"color: #00b050;\">vmware<\/span><span style=\"color: #00b050;\"> : Get Date] *********************************************************************************************<\/span><\/strong><\/p>\n<p style=\"text-align: left; margin-top: 0pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.2;\"><strong><span style=\"color: #00b050;\">changed: [v-sits-test4]<\/span><\/strong><\/p>\n<p style=\"text-align: left; margin-top: 0pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.2;\"><span style=\"display: inline-block; height: 1em;\"><span style=\"display: none;\">.<\/span><\/span><\/p>\n<p style=\"text-align: left; margin-top: 0pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.2;\"><strong><span style=\"color: #00b050;\">TASK [custom-tags-attributes-<\/span><span style=\"color: #00b050;\">vmware<\/span><span style=\"color: #00b050;\"> : <\/span><span style=\"color: #00b050;\">set_fact<\/span><span style=\"color: #00b050;\">] *********************************************************************************************<\/span><\/strong><\/p>\n<p style=\"text-align: left; margin-top: 0pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.2;\"><strong><span style=\"color: #00b050;\">ok: [v-sits-test4]<\/span><\/strong><\/p>\n<p style=\"text-align: left; margin-top: 0pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.2;\"><span style=\"display: inline-block; height: 1em;\"><span style=\"display: none;\">.<\/span><\/span><\/p>\n<p style=\"text-align: left; margin-top: 0pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.2;\"><strong><span style=\"color: #00b050;\">TASK [custom-tags-attributes-<\/span><span style=\"color: #00b050;\">vmware<\/span><span style=\"color: #00b050;\"> : Add multiple virtual machine custom attributes] *******************************************************<\/span><\/strong><\/p>\n<p style=\"text-align: left; margin-top: 0pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.2;\"><strong><span style=\"color: #00b050;\">ok: [v-sits-test4]<\/span><\/strong><\/p>\n<p style=\"text-align: left; margin-top: 0pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.2;\"><span style=\"display: inline-block; height: 1em;\"><span style=\"display: none;\">.<\/span><\/span><\/p>\n<p style=\"text-align: left; margin-top: 0pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.2;\"><strong><span style=\"color: #00b050;\">TASK [custom-tags-attributes-<\/span><span style=\"color: #00b050;\">vmware<\/span><span style=\"color: #00b050;\"> : Gather facts about tag categories] ********************************************************************<\/span><\/strong><\/p>\n<p style=\"text-align: left; margin-top: 0pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.2;\"><strong><span style=\"color: #00b050;\">ok: [v-sits-test4]<\/span><\/strong><\/p>\n<p style=\"text-align: left; margin-top: 0pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.2;\"><span style=\"display: inline-block; height: 1em;\"><span style=\"display: none;\">.<\/span><\/span><\/p>\n<p style=\"text-align: left; margin-top: 0pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.2;\"><strong><span style=\"color: #00b050;\">TASK [custom-tags-attributes-<\/span><span style=\"color: #00b050;\">vmware<\/span><span style=\"color: #00b050;\"> : Add tags to a virtual machine] ************************************************************************<\/span><\/strong><\/p>\n<p style=\"text-align: left; margin-top: 0pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.2;\"><strong><span style=\"color: #00b050;\">ok: [v-sits-test4]<\/span><\/strong><\/p>\n<p style=\"text-align: left; margin-top: 0pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.2;\"><span style=\"display: inline-block; height: 1em;\"><span style=\"display: none;\">.<\/span><\/span><\/p>\n<p style=\"text-align: left; margin-top: 0pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.2;\"><strong><span style=\"color: #00b050;\">PLAY RECAP **********************************************************************************************************************************<\/span><\/strong><\/p>\n<p style=\"text-align: left; margin-top: 0pt; padding-top: 0; margin-bottom: 0pt; padding-bottom: 0; line-height: 1.2;\"><strong><span style=\"color: #00b050;\">v-sits-test4 : ok=9 changed=1 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0<\/span><\/strong><\/p>\n<\/div>\n<\/div>\n<p style=\"margin-top: 0pt; padding-top: 0; margin-bottom: 8pt; padding-bottom: 0; line-height: 1.3;\"><span style=\"display: inline-block; height: 1em;\"><span style=\"display: none;\">.<\/span><\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>So whether your using cloud or doing in house deploys. Tagging is a used a lot especially in cloud type environments. Which we will cover in later posts. So a common reason to tag your vm is wanting to have the creation date and the type of server or environment its using, handy for backup solutions &amp; other auditables. .<a href=\"https:\/\/nicktailor.com\/tech-blog\/how-to-add-vm-tags-and-custom-attributes-with-anisblevmware\/\" class=\"read-more\">Read More &#8230;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[51,129],"tags":[],"class_list":["post-1359","post","type-post","status-publish","format-standard","hentry","category-ansible","category-vmware"],"_links":{"self":[{"href":"https:\/\/nicktailor.com\/tech-blog\/wp-json\/wp\/v2\/posts\/1359","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/nicktailor.com\/tech-blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/nicktailor.com\/tech-blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/nicktailor.com\/tech-blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/nicktailor.com\/tech-blog\/wp-json\/wp\/v2\/comments?post=1359"}],"version-history":[{"count":28,"href":"https:\/\/nicktailor.com\/tech-blog\/wp-json\/wp\/v2\/posts\/1359\/revisions"}],"predecessor-version":[{"id":1388,"href":"https:\/\/nicktailor.com\/tech-blog\/wp-json\/wp\/v2\/posts\/1359\/revisions\/1388"}],"wp:attachment":[{"href":"https:\/\/nicktailor.com\/tech-blog\/wp-json\/wp\/v2\/media?parent=1359"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/nicktailor.com\/tech-blog\/wp-json\/wp\/v2\/categories?post=1359"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/nicktailor.com\/tech-blog\/wp-json\/wp\/v2\/tags?post=1359"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}