SlideShare a Scribd company logo
1 of 37
Embedded Ansible in
Cloudform
Prasad Mukhedkar
Agenda
● Introduction to Embedded Ansible
● Enabling Embedded Ansible
● Tuning Embedded Ansible
● Adding Playbook Repositories and Credentials
● Run Playbook From Service
● Run Playbook from button
● Run playbook as part of Automate State Machine ( Automate)
● Troubleshooting
● Future
Introduction
Embedded Ansible is optional automation engine in
cloudforms to simplify automation workflows. Alternative
to Ruby based automation framework.
Headless Ansible Tower is installed and configured on the
cloudforms appliance for implementation of Ansible
automation engine.
Activating Embedded Ansible
- Enabling ‘Embedded Ansible’ role activates Ansible
automation engine.
- Upon activating the role, tower setup command is
triggered to setup the tower, this activity may take several
minutes.
- All the packages of ansible tower are shipped in the
Activating Embedded Ansible
Ansible Tower Setup playbook
-> #ansible-tower-setup
- > #/var/lib/awx/setup/setup.sh
-> # /var/lib/awx/setup/install.yml
Activating Embedded Ansible
/var/lib/awx/setup/inventory
[tower]
localhost ansible_connection=local
[database]
[all:vars]
admin_password=''
pg_host=''
pg_port=''
pg_database='awx'
pg_username='awx'
pg_password=''
rabbitmq_username=tower
rabbitmq_password=''
rabbitmq_cookie=cookiemonster
admin_password=''
rabbitmq_password=''
admin_password=''
All passwords generated
dynamically !
def find_or_create_admin_authentication
miq_database.ansible_admin_authentication ||
miq_database.set_ansible_admin_authentication(:
password => generate_password)
end
Activating Embedded Ansible
EmbeddedAnsible Processes ^
Core Embedded Ansible Services (Supervisord)
Embedded Ansible Logs
Setup Logs :
LOG_DIR="/var/log/tower"
LOG_FILE="${LOG_DIR}/setup-${TIMESTAMP}.log"
Other Logs :
/var/log/tower/tower.log
/var/log/tower/task_system.log
Embedded Ansible Logs
Ansible Tower Core Logs
Embedded Ansible APIs
Endpoint : https://cloudformsIP/ansibleapi/
Note: Ansible Tower API cannot be accessed from a
browser since the browser based authentication plug-
in is not installed. You have to use API clients like
postman or insomnia or curl command
Embedded Ansible APIs : Authentication
Admin Password is generated randomly at the time of ansible Setup. To
get the password you need to query rails.
# vmdb ; echo "MiqDatabase.first.ansible_admin_authentication.password " | rails c
Admin Password ^
# vmdb ; echo "MiqDatabase.first.ansible_aansible_rabbitmq_authentication.password
" | rails c
# vmdb ; echo "MiqDatabase.first.ansible_database_authentication.password " | rails
c
Embedded Ansible Database
Postgres Database Named : AWX
Credentials : No credentials need to pass if you login locally. Peer Authentication
[root@dhcp130-127 data]# cat pg_hba.conf
# TYPE DATABASE USER ADDRESS METHOD
local all all peer map=usermap
local replication all peer map=usermap
hostssl all all all md5
host replication all all md5
#psql -U postgres -d awx
Advanced Configuration : Proxy
:embedded_ansible:
:host:
:password:
:port:
:user:
:scheme:
:job_data_retention_days
Consideration
- Enabling Embedded Ansible role in highly available region is not
supported in 4.6 < lower version, support is added in 4.7.
- Maximum concurrent workers for embedded ansible is 1.
- 2 GB Memory overhead
- EmbeddedAnsibleWorker, When looking at the diagnostics > workers, no
information about CPU and memory is displayed for Embedded
Ansible worker.
- Embedded ansible is not zone aware.
- Support playbooks executed from the scheduler not supported.
Adding Playbook
Repositories
Adding Repository
Adding Repository
- ems_operations role is responsible to perform all the repository add/remove actions.
- Need network connectivity to sync repos.
- Make Sure embedded ansible role is running state before adding repo, how to check
that : https://cloudformsIP/ansibleapi/v1/ping/
- To activate proxy for embedded ansible, you need to turn off and on the embedded
ansible role.
- Syncing git repository over SSL protocol fails if the SSL certificate is self-singed. To
workaround, disable SSL verification for git. Add following line /etc/tower/settings.py file
and restart the service.
"AWX_TASK_ENV": { "GIT_SSL_NO_VERIFY": "True" }
- YAML three dashes (---) are important in playbook. Playbooks which are not starting with --- will not be
detected by cloudforms.
Offline Repository | Not Officially Supported
vmdb; rails c
conn = EmbeddedAnsible.new.api_connection
conn.api.projects.create!(:name => "My Project", :scm_type => "git", :scm_url =>
"file:///opt/ansible_playbooks", :scm_update_on_launch => false, :organization =>
ManageIQ::Providers::EmbeddedAnsible::Provider.first.default_organization)
Adding Credentials
Adding Credential
Automation > Ansible > Credentials > Add New Credential
Run Playbook As Service
Playbook As Service
Playbook services are created in the same way as other service catalog
items, via the Catalog Items accordion in the Services -> Catalogs
section of the WebUI.
1. Navigate to Services/Catalogs/Catalog Items.
2. Create "Ansible Playbook" catalog item with "Provision" and
"Retirement" tabs filled, add some extra vars.
3. Open the catalog item detail screen, click on Retirement tab.
4. Navigate to Services/Service Catalogs.
5. Order the service.
6. Wait until it will be provisioned.
7. Navigate to Services/My Services.
8. Click on the service in the tree.
9. Click Lifecycle/Retire this Service.
10. Wait until retirement will be finished.
11. Open Retirement tab of the service in My Services.
Run Playbook from Button
Run Playbook from Button
The Ansible Playbook button type still calls the
/System/Request/Order_Ansible_Playbook instance to launch the playbook service, but it
simplifies the process of creating the parameters that the order_ansible_playbook method
uses.
Run Playbook from
Control Policy
Run Playbook from Control Policy
1. Create a ansible Service catalog that you wish to
execute as part of control policy.
2. Navigate to Control/Explorer.
3. Expand Actions accordion.
4. Click Configuration/Add a new Action.
5. In action type choose "Run Ansible Playbook".
6. In Playbook Catalog Item choose just created catalog item.
7. Assign this action to some event in a host or vm control policy.
8. Assign policy profile which contains that policy to some host or vm.
9. Trigger the event which assigned to the policy.
Run Playbook from
Automation
Run Playbook from Automation (State
Machine)
1. Create a domain, a namespace, a class and an
instance.
2. Click on Methods tab of the instance.
3. Click Configuration/Create new method.
4. In the dropdown menu pick "Ansible Playbook".
5. Fill the required fields.
6. Navigate to Automate Simulation.
Troubleshooting
1 . Restart Ansible Tower by turning on / off Embedded Ansible Role.
2. Restart Embedded Ansible from Rails Console.
# vmdb ; echo " EmbeddedAnsibleWorker.destroy_all " | rails c
TroubleShooting : Re-Setup
systemctl restart evmserverd #to be sure memory is freeed up
rm /etc/tower/SECRET_KEY
vmdb
bin/rails r 'MiqDatabase.first.ansible_secret_key = nil'
bin/rails r 'MiqDatabase.first.ansible_database_authentication.destroy'
bin/rails r 'ManageIQ::Providers::EmbeddedAnsible::Provider.first.destroy'
psql -d vmdb_production -c 'DROP DATABASE awx' # run on the db appliance
psql -d vmdb_production -c 'DROP ROLE awx' # run on the db appliance
Login to to the UI and enable Ansible role
check /var/log/tower/setup-.log for status
TroubleShooting : Installing pyhton modules
# source /var/lib/awx/venv/ansible/bin/activate
# umask 0022
# pip install --upgrade module
# deactivate
TroubleShooting : Windows Machines
ansible_connection: winrm
ansible_winrm_server_cert_validation: ignore
ansible_winrm_read_timeout_sec: 150
ansible_winrm_operation_timeout_sec: 120
TroubleShooting : Playbook Execution output
grep ServiceAnsiblePlaybook#log_stdout
/var/www/miq/vmdb/evm.log
[----] I, [2019-04-18T05:03:29.338193 #5474:db06c8] INFO -- : Q-
task_id([r10000000000001_service_template_provision_task_10000000000001])
MIQ(ServiceAnsiblePlaybook#log_stdout) Stdout from ansible job miq_Ping_provision: ansible-playbook 2.7.9
TroubleShooting : Playbook Logging Verbosity
Future
Headless tower will be replaced by Ansible Runner , Ansible Runner 1.1.2
(https://ansible-runner.readthedocs.io/en/latest/) is included in 4.7 with
appliance and used for some provider-related operations.
Reference
https://manageiq.gitbook.io/mastering-cloudforms-automation-addendum/embedded

More Related Content

What's hot

Troubleshooting Tracebacks
Troubleshooting TracebacksTroubleshooting Tracebacks
Troubleshooting TracebacksJames Denton
 
Open stack networking_101_part-1
Open stack networking_101_part-1Open stack networking_101_part-1
Open stack networking_101_part-1yfauser
 
Pushing Packets - How do the ML2 Mechanism Drivers Stack Up
Pushing Packets - How do the ML2 Mechanism Drivers Stack UpPushing Packets - How do the ML2 Mechanism Drivers Stack Up
Pushing Packets - How do the ML2 Mechanism Drivers Stack UpJames Denton
 
Linux Tag 2014 OpenStack Networking
Linux Tag 2014 OpenStack NetworkingLinux Tag 2014 OpenStack Networking
Linux Tag 2014 OpenStack Networkingyfauser
 
2014 OpenStack Summit - Neutron OVS to LinuxBridge Migration
2014 OpenStack Summit - Neutron OVS to LinuxBridge Migration2014 OpenStack Summit - Neutron OVS to LinuxBridge Migration
2014 OpenStack Summit - Neutron OVS to LinuxBridge MigrationJames Denton
 
Open vSwitch Implementation Options
Open vSwitch Implementation Options Open vSwitch Implementation Options
Open vSwitch Implementation Options Netronome
 
VMworld 2013: Extreme Performance Series: Network Speed Ahead
VMworld 2013: Extreme Performance Series: Network Speed Ahead VMworld 2013: Extreme Performance Series: Network Speed Ahead
VMworld 2013: Extreme Performance Series: Network Speed Ahead VMworld
 
OpenStack Neutron Tutorial
OpenStack Neutron TutorialOpenStack Neutron Tutorial
OpenStack Neutron Tutorialmestery
 
Understanding Open vSwitch
Understanding Open vSwitch Understanding Open vSwitch
Understanding Open vSwitch YongKi Kim
 
SDN and Mininet: Some Basic Concepts
SDN and Mininet: Some Basic ConceptsSDN and Mininet: Some Basic Concepts
SDN and Mininet: Some Basic ConceptsEswar Publications
 
Quantum (OpenStack Meetup Feb 9th, 2012)
Quantum (OpenStack Meetup Feb 9th, 2012)Quantum (OpenStack Meetup Feb 9th, 2012)
Quantum (OpenStack Meetup Feb 9th, 2012)Dan Wendlandt
 
VMworld 2013: vSphere Distributed Switch – Design and Best Practices
VMworld 2013: vSphere Distributed Switch – Design and Best Practices VMworld 2013: vSphere Distributed Switch – Design and Best Practices
VMworld 2013: vSphere Distributed Switch – Design and Best Practices VMworld
 
OVN - Basics and deep dive
OVN - Basics and deep diveOVN - Basics and deep dive
OVN - Basics and deep diveTrinath Somanchi
 
Overview of Distributed Virtual Router (DVR) in Openstack/Neutron
Overview of Distributed Virtual Router (DVR) in Openstack/NeutronOverview of Distributed Virtual Router (DVR) in Openstack/Neutron
Overview of Distributed Virtual Router (DVR) in Openstack/Neutronvivekkonnect
 
OpenStack networking
OpenStack networkingOpenStack networking
OpenStack networkingSim Janghoon
 
Nova net-or-neutron-atlanta2014.pptx
Nova net-or-neutron-atlanta2014.pptxNova net-or-neutron-atlanta2014.pptx
Nova net-or-neutron-atlanta2014.pptxSomik Behera
 
Open Source Backends for OpenStack Neutron
Open Source Backends for OpenStack NeutronOpen Source Backends for OpenStack Neutron
Open Source Backends for OpenStack Neutronmestery
 
Network virtualization with open stack quantum
Network virtualization with open stack quantumNetwork virtualization with open stack quantum
Network virtualization with open stack quantumMiguel Lavalle
 
Open stack networking vlan, gre
Open stack networking   vlan, greOpen stack networking   vlan, gre
Open stack networking vlan, greSim Janghoon
 

What's hot (20)

Troubleshooting Tracebacks
Troubleshooting TracebacksTroubleshooting Tracebacks
Troubleshooting Tracebacks
 
Open stack networking_101_part-1
Open stack networking_101_part-1Open stack networking_101_part-1
Open stack networking_101_part-1
 
Pushing Packets - How do the ML2 Mechanism Drivers Stack Up
Pushing Packets - How do the ML2 Mechanism Drivers Stack UpPushing Packets - How do the ML2 Mechanism Drivers Stack Up
Pushing Packets - How do the ML2 Mechanism Drivers Stack Up
 
Linux Tag 2014 OpenStack Networking
Linux Tag 2014 OpenStack NetworkingLinux Tag 2014 OpenStack Networking
Linux Tag 2014 OpenStack Networking
 
2014 OpenStack Summit - Neutron OVS to LinuxBridge Migration
2014 OpenStack Summit - Neutron OVS to LinuxBridge Migration2014 OpenStack Summit - Neutron OVS to LinuxBridge Migration
2014 OpenStack Summit - Neutron OVS to LinuxBridge Migration
 
Open vSwitch Implementation Options
Open vSwitch Implementation Options Open vSwitch Implementation Options
Open vSwitch Implementation Options
 
VMworld 2013: Extreme Performance Series: Network Speed Ahead
VMworld 2013: Extreme Performance Series: Network Speed Ahead VMworld 2013: Extreme Performance Series: Network Speed Ahead
VMworld 2013: Extreme Performance Series: Network Speed Ahead
 
rtnetlink
rtnetlinkrtnetlink
rtnetlink
 
OpenStack Neutron Tutorial
OpenStack Neutron TutorialOpenStack Neutron Tutorial
OpenStack Neutron Tutorial
 
Understanding Open vSwitch
Understanding Open vSwitch Understanding Open vSwitch
Understanding Open vSwitch
 
SDN and Mininet: Some Basic Concepts
SDN and Mininet: Some Basic ConceptsSDN and Mininet: Some Basic Concepts
SDN and Mininet: Some Basic Concepts
 
Quantum (OpenStack Meetup Feb 9th, 2012)
Quantum (OpenStack Meetup Feb 9th, 2012)Quantum (OpenStack Meetup Feb 9th, 2012)
Quantum (OpenStack Meetup Feb 9th, 2012)
 
VMworld 2013: vSphere Distributed Switch – Design and Best Practices
VMworld 2013: vSphere Distributed Switch – Design and Best Practices VMworld 2013: vSphere Distributed Switch – Design and Best Practices
VMworld 2013: vSphere Distributed Switch – Design and Best Practices
 
OVN - Basics and deep dive
OVN - Basics and deep diveOVN - Basics and deep dive
OVN - Basics and deep dive
 
Overview of Distributed Virtual Router (DVR) in Openstack/Neutron
Overview of Distributed Virtual Router (DVR) in Openstack/NeutronOverview of Distributed Virtual Router (DVR) in Openstack/Neutron
Overview of Distributed Virtual Router (DVR) in Openstack/Neutron
 
OpenStack networking
OpenStack networkingOpenStack networking
OpenStack networking
 
Nova net-or-neutron-atlanta2014.pptx
Nova net-or-neutron-atlanta2014.pptxNova net-or-neutron-atlanta2014.pptx
Nova net-or-neutron-atlanta2014.pptx
 
Open Source Backends for OpenStack Neutron
Open Source Backends for OpenStack NeutronOpen Source Backends for OpenStack Neutron
Open Source Backends for OpenStack Neutron
 
Network virtualization with open stack quantum
Network virtualization with open stack quantumNetwork virtualization with open stack quantum
Network virtualization with open stack quantum
 
Open stack networking vlan, gre
Open stack networking   vlan, greOpen stack networking   vlan, gre
Open stack networking vlan, gre
 

Similar to Ansible Automation Inside Cloudforms ( Embedded Ansible)

Automation with Ansible and Containers
Automation with Ansible and ContainersAutomation with Ansible and Containers
Automation with Ansible and ContainersRodolfo Carvalho
 
DB proxy server test: run tests on tens of virtual machines with Jenkins, Vag...
DB proxy server test: run tests on tens of virtual machines with Jenkins, Vag...DB proxy server test: run tests on tens of virtual machines with Jenkins, Vag...
DB proxy server test: run tests on tens of virtual machines with Jenkins, Vag...Timofey Turenko
 
Ansible Tutorial.pdf
Ansible Tutorial.pdfAnsible Tutorial.pdf
Ansible Tutorial.pdfNigussMehari4
 
Weaveworks at AWS re:Invent 2016: Operations Management with Amazon ECS
Weaveworks at AWS re:Invent 2016: Operations Management with Amazon ECSWeaveworks at AWS re:Invent 2016: Operations Management with Amazon ECS
Weaveworks at AWS re:Invent 2016: Operations Management with Amazon ECSWeaveworks
 
Rapid scaling in_the_cloud_with_puppet
Rapid scaling in_the_cloud_with_puppetRapid scaling in_the_cloud_with_puppet
Rapid scaling in_the_cloud_with_puppetCarl Caum
 
Ansible presentation
Ansible presentationAnsible presentation
Ansible presentationSuresh Kumar
 
AutoScaling and Drupal
AutoScaling and DrupalAutoScaling and Drupal
AutoScaling and DrupalPromet Source
 
Okd wg kubecon marathon azure &amp; vsphere
Okd wg kubecon marathon azure &amp; vsphereOkd wg kubecon marathon azure &amp; vsphere
Okd wg kubecon marathon azure &amp; vsphereWalid Shaari
 
DevOps for the Enterprise: Virtual Office Hours
DevOps for the Enterprise: Virtual Office HoursDevOps for the Enterprise: Virtual Office Hours
DevOps for the Enterprise: Virtual Office HoursAmazon Web Services
 
Building a Serverless company with Node.js, React and the Serverless Framewor...
Building a Serverless company with Node.js, React and the Serverless Framewor...Building a Serverless company with Node.js, React and the Serverless Framewor...
Building a Serverless company with Node.js, React and the Serverless Framewor...Luciano Mammino
 
Artem Zhurbila - docker clusters (solit 2015)
Artem Zhurbila - docker clusters (solit 2015)Artem Zhurbila - docker clusters (solit 2015)
Artem Zhurbila - docker clusters (solit 2015)Artem Zhurbila
 
Google Cloud Platform for DeVops, by Javier Ramirez @ teowaki
Google Cloud Platform for DeVops, by Javier Ramirez @ teowakiGoogle Cloud Platform for DeVops, by Javier Ramirez @ teowaki
Google Cloud Platform for DeVops, by Javier Ramirez @ teowakijavier ramirez
 
A 60-minute tour of AWS Compute (November 2016)
A 60-minute tour of AWS Compute (November 2016)A 60-minute tour of AWS Compute (November 2016)
A 60-minute tour of AWS Compute (November 2016)Julien SIMON
 
Shopping for Vulnerabilities - How Cloud Service Provider Marketplaces can He...
Shopping for Vulnerabilities - How Cloud Service Provider Marketplaces can He...Shopping for Vulnerabilities - How Cloud Service Provider Marketplaces can He...
Shopping for Vulnerabilities - How Cloud Service Provider Marketplaces can He...Tenchi Security
 
Shopping for Vulnerabilities - How Cloud Service Provider Marketplaces can He...
Shopping for Vulnerabilities - How Cloud Service Provider Marketplaces can He...Shopping for Vulnerabilities - How Cloud Service Provider Marketplaces can He...
Shopping for Vulnerabilities - How Cloud Service Provider Marketplaces can He...Alexandre Sieira
 
AWS Lambda with Serverless Framework and Java
AWS Lambda with Serverless Framework and JavaAWS Lambda with Serverless Framework and Java
AWS Lambda with Serverless Framework and JavaManish Pandit
 
NGINX Can Do That? Test Drive Your Config File!
NGINX Can Do That? Test Drive Your Config File!NGINX Can Do That? Test Drive Your Config File!
NGINX Can Do That? Test Drive Your Config File!Jeff Anderson
 
An Ensemble Core with Docker - Solving a Real Pain in the PaaS
An Ensemble Core with Docker - Solving a Real Pain in the PaaS An Ensemble Core with Docker - Solving a Real Pain in the PaaS
An Ensemble Core with Docker - Solving a Real Pain in the PaaS Erik Osterman
 

Similar to Ansible Automation Inside Cloudforms ( Embedded Ansible) (20)

Automation with Ansible and Containers
Automation with Ansible and ContainersAutomation with Ansible and Containers
Automation with Ansible and Containers
 
DB proxy server test: run tests on tens of virtual machines with Jenkins, Vag...
DB proxy server test: run tests on tens of virtual machines with Jenkins, Vag...DB proxy server test: run tests on tens of virtual machines with Jenkins, Vag...
DB proxy server test: run tests on tens of virtual machines with Jenkins, Vag...
 
Ansible Tutorial.pdf
Ansible Tutorial.pdfAnsible Tutorial.pdf
Ansible Tutorial.pdf
 
Ansible - Hands on Training
Ansible - Hands on TrainingAnsible - Hands on Training
Ansible - Hands on Training
 
Weaveworks at AWS re:Invent 2016: Operations Management with Amazon ECS
Weaveworks at AWS re:Invent 2016: Operations Management with Amazon ECSWeaveworks at AWS re:Invent 2016: Operations Management with Amazon ECS
Weaveworks at AWS re:Invent 2016: Operations Management with Amazon ECS
 
Rapid scaling in_the_cloud_with_puppet
Rapid scaling in_the_cloud_with_puppetRapid scaling in_the_cloud_with_puppet
Rapid scaling in_the_cloud_with_puppet
 
One-Man Ops
One-Man OpsOne-Man Ops
One-Man Ops
 
Ansible presentation
Ansible presentationAnsible presentation
Ansible presentation
 
AutoScaling and Drupal
AutoScaling and DrupalAutoScaling and Drupal
AutoScaling and Drupal
 
Okd wg kubecon marathon azure &amp; vsphere
Okd wg kubecon marathon azure &amp; vsphereOkd wg kubecon marathon azure &amp; vsphere
Okd wg kubecon marathon azure &amp; vsphere
 
DevOps for the Enterprise: Virtual Office Hours
DevOps for the Enterprise: Virtual Office HoursDevOps for the Enterprise: Virtual Office Hours
DevOps for the Enterprise: Virtual Office Hours
 
Building a Serverless company with Node.js, React and the Serverless Framewor...
Building a Serverless company with Node.js, React and the Serverless Framewor...Building a Serverless company with Node.js, React and the Serverless Framewor...
Building a Serverless company with Node.js, React and the Serverless Framewor...
 
Artem Zhurbila - docker clusters (solit 2015)
Artem Zhurbila - docker clusters (solit 2015)Artem Zhurbila - docker clusters (solit 2015)
Artem Zhurbila - docker clusters (solit 2015)
 
Google Cloud Platform for DeVops, by Javier Ramirez @ teowaki
Google Cloud Platform for DeVops, by Javier Ramirez @ teowakiGoogle Cloud Platform for DeVops, by Javier Ramirez @ teowaki
Google Cloud Platform for DeVops, by Javier Ramirez @ teowaki
 
A 60-minute tour of AWS Compute (November 2016)
A 60-minute tour of AWS Compute (November 2016)A 60-minute tour of AWS Compute (November 2016)
A 60-minute tour of AWS Compute (November 2016)
 
Shopping for Vulnerabilities - How Cloud Service Provider Marketplaces can He...
Shopping for Vulnerabilities - How Cloud Service Provider Marketplaces can He...Shopping for Vulnerabilities - How Cloud Service Provider Marketplaces can He...
Shopping for Vulnerabilities - How Cloud Service Provider Marketplaces can He...
 
Shopping for Vulnerabilities - How Cloud Service Provider Marketplaces can He...
Shopping for Vulnerabilities - How Cloud Service Provider Marketplaces can He...Shopping for Vulnerabilities - How Cloud Service Provider Marketplaces can He...
Shopping for Vulnerabilities - How Cloud Service Provider Marketplaces can He...
 
AWS Lambda with Serverless Framework and Java
AWS Lambda with Serverless Framework and JavaAWS Lambda with Serverless Framework and Java
AWS Lambda with Serverless Framework and Java
 
NGINX Can Do That? Test Drive Your Config File!
NGINX Can Do That? Test Drive Your Config File!NGINX Can Do That? Test Drive Your Config File!
NGINX Can Do That? Test Drive Your Config File!
 
An Ensemble Core with Docker - Solving a Real Pain in the PaaS
An Ensemble Core with Docker - Solving a Real Pain in the PaaS An Ensemble Core with Docker - Solving a Real Pain in the PaaS
An Ensemble Core with Docker - Solving a Real Pain in the PaaS
 

Recently uploaded

Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsRoshan Dwivedi
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 

Recently uploaded (20)

Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 

Ansible Automation Inside Cloudforms ( Embedded Ansible)

  • 2. Agenda ● Introduction to Embedded Ansible ● Enabling Embedded Ansible ● Tuning Embedded Ansible ● Adding Playbook Repositories and Credentials ● Run Playbook From Service ● Run Playbook from button ● Run playbook as part of Automate State Machine ( Automate) ● Troubleshooting ● Future
  • 3. Introduction Embedded Ansible is optional automation engine in cloudforms to simplify automation workflows. Alternative to Ruby based automation framework. Headless Ansible Tower is installed and configured on the cloudforms appliance for implementation of Ansible automation engine.
  • 4. Activating Embedded Ansible - Enabling ‘Embedded Ansible’ role activates Ansible automation engine. - Upon activating the role, tower setup command is triggered to setup the tower, this activity may take several minutes. - All the packages of ansible tower are shipped in the
  • 5. Activating Embedded Ansible Ansible Tower Setup playbook -> #ansible-tower-setup - > #/var/lib/awx/setup/setup.sh -> # /var/lib/awx/setup/install.yml
  • 6. Activating Embedded Ansible /var/lib/awx/setup/inventory [tower] localhost ansible_connection=local [database] [all:vars] admin_password='' pg_host='' pg_port='' pg_database='awx' pg_username='awx' pg_password='' rabbitmq_username=tower rabbitmq_password='' rabbitmq_cookie=cookiemonster admin_password='' rabbitmq_password='' admin_password='' All passwords generated dynamically ! def find_or_create_admin_authentication miq_database.ansible_admin_authentication || miq_database.set_ansible_admin_authentication(: password => generate_password) end
  • 7. Activating Embedded Ansible EmbeddedAnsible Processes ^ Core Embedded Ansible Services (Supervisord)
  • 8. Embedded Ansible Logs Setup Logs : LOG_DIR="/var/log/tower" LOG_FILE="${LOG_DIR}/setup-${TIMESTAMP}.log" Other Logs : /var/log/tower/tower.log /var/log/tower/task_system.log
  • 10. Embedded Ansible APIs Endpoint : https://cloudformsIP/ansibleapi/ Note: Ansible Tower API cannot be accessed from a browser since the browser based authentication plug- in is not installed. You have to use API clients like postman or insomnia or curl command
  • 11. Embedded Ansible APIs : Authentication Admin Password is generated randomly at the time of ansible Setup. To get the password you need to query rails. # vmdb ; echo "MiqDatabase.first.ansible_admin_authentication.password " | rails c Admin Password ^ # vmdb ; echo "MiqDatabase.first.ansible_aansible_rabbitmq_authentication.password " | rails c # vmdb ; echo "MiqDatabase.first.ansible_database_authentication.password " | rails c
  • 12. Embedded Ansible Database Postgres Database Named : AWX Credentials : No credentials need to pass if you login locally. Peer Authentication [root@dhcp130-127 data]# cat pg_hba.conf # TYPE DATABASE USER ADDRESS METHOD local all all peer map=usermap local replication all peer map=usermap hostssl all all all md5 host replication all all md5 #psql -U postgres -d awx
  • 13. Advanced Configuration : Proxy :embedded_ansible: :host: :password: :port: :user: :scheme: :job_data_retention_days
  • 14. Consideration - Enabling Embedded Ansible role in highly available region is not supported in 4.6 < lower version, support is added in 4.7. - Maximum concurrent workers for embedded ansible is 1. - 2 GB Memory overhead - EmbeddedAnsibleWorker, When looking at the diagnostics > workers, no information about CPU and memory is displayed for Embedded Ansible worker. - Embedded ansible is not zone aware. - Support playbooks executed from the scheduler not supported.
  • 17. Adding Repository - ems_operations role is responsible to perform all the repository add/remove actions. - Need network connectivity to sync repos. - Make Sure embedded ansible role is running state before adding repo, how to check that : https://cloudformsIP/ansibleapi/v1/ping/ - To activate proxy for embedded ansible, you need to turn off and on the embedded ansible role. - Syncing git repository over SSL protocol fails if the SSL certificate is self-singed. To workaround, disable SSL verification for git. Add following line /etc/tower/settings.py file and restart the service. "AWX_TASK_ENV": { "GIT_SSL_NO_VERIFY": "True" } - YAML three dashes (---) are important in playbook. Playbooks which are not starting with --- will not be detected by cloudforms.
  • 18. Offline Repository | Not Officially Supported vmdb; rails c conn = EmbeddedAnsible.new.api_connection conn.api.projects.create!(:name => "My Project", :scm_type => "git", :scm_url => "file:///opt/ansible_playbooks", :scm_update_on_launch => false, :organization => ManageIQ::Providers::EmbeddedAnsible::Provider.first.default_organization)
  • 20. Adding Credential Automation > Ansible > Credentials > Add New Credential
  • 21. Run Playbook As Service
  • 22. Playbook As Service Playbook services are created in the same way as other service catalog items, via the Catalog Items accordion in the Services -> Catalogs section of the WebUI.
  • 23. 1. Navigate to Services/Catalogs/Catalog Items. 2. Create "Ansible Playbook" catalog item with "Provision" and "Retirement" tabs filled, add some extra vars. 3. Open the catalog item detail screen, click on Retirement tab. 4. Navigate to Services/Service Catalogs. 5. Order the service. 6. Wait until it will be provisioned. 7. Navigate to Services/My Services. 8. Click on the service in the tree. 9. Click Lifecycle/Retire this Service. 10. Wait until retirement will be finished. 11. Open Retirement tab of the service in My Services.
  • 25. Run Playbook from Button The Ansible Playbook button type still calls the /System/Request/Order_Ansible_Playbook instance to launch the playbook service, but it simplifies the process of creating the parameters that the order_ansible_playbook method uses.
  • 27. Run Playbook from Control Policy 1. Create a ansible Service catalog that you wish to execute as part of control policy. 2. Navigate to Control/Explorer. 3. Expand Actions accordion. 4. Click Configuration/Add a new Action. 5. In action type choose "Run Ansible Playbook". 6. In Playbook Catalog Item choose just created catalog item. 7. Assign this action to some event in a host or vm control policy. 8. Assign policy profile which contains that policy to some host or vm. 9. Trigger the event which assigned to the policy.
  • 29. Run Playbook from Automation (State Machine) 1. Create a domain, a namespace, a class and an instance. 2. Click on Methods tab of the instance. 3. Click Configuration/Create new method. 4. In the dropdown menu pick "Ansible Playbook". 5. Fill the required fields. 6. Navigate to Automate Simulation.
  • 30. Troubleshooting 1 . Restart Ansible Tower by turning on / off Embedded Ansible Role. 2. Restart Embedded Ansible from Rails Console. # vmdb ; echo " EmbeddedAnsibleWorker.destroy_all " | rails c
  • 31. TroubleShooting : Re-Setup systemctl restart evmserverd #to be sure memory is freeed up rm /etc/tower/SECRET_KEY vmdb bin/rails r 'MiqDatabase.first.ansible_secret_key = nil' bin/rails r 'MiqDatabase.first.ansible_database_authentication.destroy' bin/rails r 'ManageIQ::Providers::EmbeddedAnsible::Provider.first.destroy' psql -d vmdb_production -c 'DROP DATABASE awx' # run on the db appliance psql -d vmdb_production -c 'DROP ROLE awx' # run on the db appliance Login to to the UI and enable Ansible role check /var/log/tower/setup-.log for status
  • 32. TroubleShooting : Installing pyhton modules # source /var/lib/awx/venv/ansible/bin/activate # umask 0022 # pip install --upgrade module # deactivate
  • 33. TroubleShooting : Windows Machines ansible_connection: winrm ansible_winrm_server_cert_validation: ignore ansible_winrm_read_timeout_sec: 150 ansible_winrm_operation_timeout_sec: 120
  • 34. TroubleShooting : Playbook Execution output grep ServiceAnsiblePlaybook#log_stdout /var/www/miq/vmdb/evm.log [----] I, [2019-04-18T05:03:29.338193 #5474:db06c8] INFO -- : Q- task_id([r10000000000001_service_template_provision_task_10000000000001]) MIQ(ServiceAnsiblePlaybook#log_stdout) Stdout from ansible job miq_Ping_provision: ansible-playbook 2.7.9
  • 35. TroubleShooting : Playbook Logging Verbosity
  • 36. Future Headless tower will be replaced by Ansible Runner , Ansible Runner 1.1.2 (https://ansible-runner.readthedocs.io/en/latest/) is included in 4.7 with appliance and used for some provider-related operations.

Editor's Notes

  1. admin_auth = find_or_create_admin_authentication https://github.com/ManageIQ/manageiq/blob/e5cc6fc5c9e515053f43ed054b7b2e27b48488b8/lib/embedded_ansible/appliance_embedded_ansible.rb
  2. admin_auth = find_or_create_admin_authentication https://github.com/ManageIQ/manageiq/blob/e5cc6fc5c9e515053f43ed054b7b2e27b48488b8/lib/embedded_ansible/appliance_embedded_ansible.rb
  3. admin_auth = find_or_create_admin_authentication https://github.com/ManageIQ/manageiq/blob/e5cc6fc5c9e515053f43ed054b7b2e27b48488b8/lib/embedded_ansible/appliance_embedded_ansible.rb
  4. https://github.com/ManageIQ/manageiq/blob/e5cc6fc5c9e515053f43ed054b7b2e27b48488b8/lib/embedded_ansible/appliance_embedded_ansible.rb
  5. https://github.com/ManageIQ/manageiq/blob/e5cc6fc5c9e515053f43ed054b7b2e27b48488b8/lib/embedded_ansible/appliance_embedded_ansible.rb
  6. https://github.com/ManageIQ/manageiq/blob/e5cc6fc5c9e515053f43ed054b7b2e27b48488b8/lib/embedded_ansible/appliance_embedded_ansible.rb
  7. https://github.com/ManageIQ/manageiq/blob/e5cc6fc5c9e515053f43ed054b7b2e27b48488b8/lib/embedded_ansible/appliance_embedded_ansible.rb
  8. job_data_retention_days
  9. https://bugzilla.redhat.com/show_bug.cgi?id=1543340
  10. Playbooks can only be imported into embedded Ansible from such an SCM tool. There is no facility to interactively create or edit playbooks in the CloudForms or ManageIQ WebUI.
  11. https://bugzilla.redhat.com/show_bug.cgi?id=1500436
  12. \
  13. \
  14. \
  15. \
  16. \
  17. \
  18. \
  19. \
  20. \
  21. \
  22. \
  23. \
  24. \
  25. \
  26. \