<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Building an Automation host in AWS in Automation/API Discussions</title>
    <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/building-an-automation-host-in-aws/m-p/313245#M2191</link>
    <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;having just painfully struggled through getting my first ansible automation to work I figured I'd share my findings here for other total beginners. It turns out my fight wasn't about getting Ansible talking to the firewall but about getting Ansible talking. And realizing that just because there's a file listing dependencies and the installer says it is checking dependencies doesn't mean it ACTUALLY deals with them. If it doesn't give details of actions it probably isn't doing anything!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you've already got a working Ansible control host in CentOS then I'd appreciate any feedback on glaring errors or QoL improvements.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The set of commands below are what I will be using to rebuild the automation host from scratch. It is starting from a CentOS 7 AMI. I've added some comments that help explain what the line is trying to do.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;#Become root for the session. Saves pre-pending sudo to many lines further down.&lt;BR /&gt;sudo su&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;#Install / update program lists. epel-release needed otherwise many packages are really old versions!&lt;/P&gt;&lt;P&gt;# -y removes the need to hit yes to continue with the install&lt;BR /&gt;yum install epel-release -y&lt;BR /&gt;yum update -y&lt;/P&gt;&lt;P&gt;yum install centos-release-scl -y&lt;BR /&gt;yum install rh-python36 -y&lt;BR /&gt;scl enable rh-python36 bash&lt;/P&gt;&lt;P&gt;# You either run the above scl line for every session!&lt;BR /&gt;# or&amp;nbsp;edit your file&amp;nbsp;~/.bash_profile:&lt;BR /&gt;# and add: source scl_source enable rh-python36&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;#Update PIP before installing anything with it&lt;/P&gt;&lt;P&gt;pip3 install --upgrade pip&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;#Install some handy basics. unzip and a text editor.&lt;BR /&gt;yum install unzip -y&lt;BR /&gt;yum install nano -y&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;#Install ansible&lt;/P&gt;&lt;P&gt;pip3 install pandevice&lt;/P&gt;&lt;P&gt;#pip3 install pan-python (appears to not be needed)&lt;/P&gt;&lt;P&gt;#pip3 install xmltodict (appears to not be needed)&lt;/P&gt;&lt;P&gt;pip3 install ansible&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;#Add a nasty hack to avoid certificate error issues for now. =1 is the default behaviour that was causing issues.&lt;/P&gt;&lt;P&gt;#This "fixes" CERTIFICATE_VERIFY_FAILED errors when you try running playbooks. It's a result of Python 2.7 enhancements.&lt;/P&gt;&lt;P&gt;#If you are having to add certificate exceptions to your browser to get to devices you probably need to add this.&lt;/P&gt;&lt;P&gt;#It effectively adds that exception for EVERYTHING so needs a better answer&lt;BR /&gt;export PYTHONHTTPSVERIFY=0&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;#Install terraform&lt;BR /&gt;curl -O &lt;A href="https://releases.hashicorp.com/terraform/0.12.21/terraform_0.12.21_linux_amd64.zip" target="_blank"&gt;https://releases.hashicorp.com/terraform/0.12.21/terraform_0.12.21_linux_amd64.zip&lt;/A&gt;&lt;BR /&gt;# echo $PATH&lt;BR /&gt;# make sure unzip destination is in the path, e.g. /usr/bin&lt;BR /&gt;unzip terraform_0.12.21_linux_amd64.zip -d /usr/bin&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;# Install TFTP and set it to start + autostart&lt;BR /&gt;yum install tftp tftp-server xinetd -y&lt;BR /&gt;# need to edit the config file afterwards, e.g. nano /etc/xinetd.d/tftp&lt;BR /&gt;# servers_args needs to have -c added after the = to allow files to be created&lt;BR /&gt;# disable needs to be set to no instead of yes so that it can be used&lt;BR /&gt;chmod 777 /var/lib/tftpboot&lt;BR /&gt;systemctl enable xinetd&lt;BR /&gt;systemctl enable tftp&lt;BR /&gt;systemctl start xinetd&lt;BR /&gt;systemctl start tftp&lt;BR /&gt;setsebool -P tftp_anon_write 1&lt;BR /&gt;setsebool -P tftp_home_dir 1&lt;/P&gt;</description>
    <pubDate>Thu, 27 Feb 2020 00:52:14 GMT</pubDate>
    <dc:creator>A_Gardner</dc:creator>
    <dc:date>2020-02-27T00:52:14Z</dc:date>
    <item>
      <title>Building an Automation host in AWS</title>
      <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/building-an-automation-host-in-aws/m-p/313245#M2191</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;having just painfully struggled through getting my first ansible automation to work I figured I'd share my findings here for other total beginners. It turns out my fight wasn't about getting Ansible talking to the firewall but about getting Ansible talking. And realizing that just because there's a file listing dependencies and the installer says it is checking dependencies doesn't mean it ACTUALLY deals with them. If it doesn't give details of actions it probably isn't doing anything!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you've already got a working Ansible control host in CentOS then I'd appreciate any feedback on glaring errors or QoL improvements.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The set of commands below are what I will be using to rebuild the automation host from scratch. It is starting from a CentOS 7 AMI. I've added some comments that help explain what the line is trying to do.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;#Become root for the session. Saves pre-pending sudo to many lines further down.&lt;BR /&gt;sudo su&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;#Install / update program lists. epel-release needed otherwise many packages are really old versions!&lt;/P&gt;&lt;P&gt;# -y removes the need to hit yes to continue with the install&lt;BR /&gt;yum install epel-release -y&lt;BR /&gt;yum update -y&lt;/P&gt;&lt;P&gt;yum install centos-release-scl -y&lt;BR /&gt;yum install rh-python36 -y&lt;BR /&gt;scl enable rh-python36 bash&lt;/P&gt;&lt;P&gt;# You either run the above scl line for every session!&lt;BR /&gt;# or&amp;nbsp;edit your file&amp;nbsp;~/.bash_profile:&lt;BR /&gt;# and add: source scl_source enable rh-python36&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;#Update PIP before installing anything with it&lt;/P&gt;&lt;P&gt;pip3 install --upgrade pip&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;#Install some handy basics. unzip and a text editor.&lt;BR /&gt;yum install unzip -y&lt;BR /&gt;yum install nano -y&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;#Install ansible&lt;/P&gt;&lt;P&gt;pip3 install pandevice&lt;/P&gt;&lt;P&gt;#pip3 install pan-python (appears to not be needed)&lt;/P&gt;&lt;P&gt;#pip3 install xmltodict (appears to not be needed)&lt;/P&gt;&lt;P&gt;pip3 install ansible&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;#Add a nasty hack to avoid certificate error issues for now. =1 is the default behaviour that was causing issues.&lt;/P&gt;&lt;P&gt;#This "fixes" CERTIFICATE_VERIFY_FAILED errors when you try running playbooks. It's a result of Python 2.7 enhancements.&lt;/P&gt;&lt;P&gt;#If you are having to add certificate exceptions to your browser to get to devices you probably need to add this.&lt;/P&gt;&lt;P&gt;#It effectively adds that exception for EVERYTHING so needs a better answer&lt;BR /&gt;export PYTHONHTTPSVERIFY=0&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;#Install terraform&lt;BR /&gt;curl -O &lt;A href="https://releases.hashicorp.com/terraform/0.12.21/terraform_0.12.21_linux_amd64.zip" target="_blank"&gt;https://releases.hashicorp.com/terraform/0.12.21/terraform_0.12.21_linux_amd64.zip&lt;/A&gt;&lt;BR /&gt;# echo $PATH&lt;BR /&gt;# make sure unzip destination is in the path, e.g. /usr/bin&lt;BR /&gt;unzip terraform_0.12.21_linux_amd64.zip -d /usr/bin&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;# Install TFTP and set it to start + autostart&lt;BR /&gt;yum install tftp tftp-server xinetd -y&lt;BR /&gt;# need to edit the config file afterwards, e.g. nano /etc/xinetd.d/tftp&lt;BR /&gt;# servers_args needs to have -c added after the = to allow files to be created&lt;BR /&gt;# disable needs to be set to no instead of yes so that it can be used&lt;BR /&gt;chmod 777 /var/lib/tftpboot&lt;BR /&gt;systemctl enable xinetd&lt;BR /&gt;systemctl enable tftp&lt;BR /&gt;systemctl start xinetd&lt;BR /&gt;systemctl start tftp&lt;BR /&gt;setsebool -P tftp_anon_write 1&lt;BR /&gt;setsebool -P tftp_home_dir 1&lt;/P&gt;</description>
      <pubDate>Thu, 27 Feb 2020 00:52:14 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/automation-api-discussions/building-an-automation-host-in-aws/m-p/313245#M2191</guid>
      <dc:creator>A_Gardner</dc:creator>
      <dc:date>2020-02-27T00:52:14Z</dc:date>
    </item>
  </channel>
</rss>

