title: Ansible AWX Custom Script for Local Inventory Not working
body: <p>I have an Ansible AWX server setup within a container and have setup all bar Inventory of 3 local LAN virtual machines.</p>
  
  <p>I am looking to add some already deployed virtual machines on my LAN for a test case, currently 3 hosts. </p>
  
  <p>I was looking at custom dynamic inventory script like contained in link below, but does not seem to run correctly for me. I see an error in python syntax. I tried to upload anyway but get and error "needs to be a json dict" when run sync within inventories. This is also the line I have syntax error on line 32:</p>
  
  <pre><code>print json.dumps(self.inventory);
  </code></pre>
  
  <p><a href="https://www.jeffgeerling.com/blog/creating-custom-dynamic-inventories-ansible" rel="nofollow noreferrer">Dynamic Inventory Script</a></p>
  
  <p>I am looking only to add the 3 host virtual machines or subnet to inventory to test some playbooks.</p>