SlideShare ist ein Scribd-Unternehmen logo
1 von 42
How to be an Ansible Contributor
Step – by – Step
Developer Advocate, Cisco
@johnamcdonough
John McDonough
John McDonough
Developer Advocate, Cisco
John Works for Cisco DevNet
JohnWrites Code
JohnTalks about Code
JohnTalks about Writing Code
John Writes OK Code andTalks Pretty GoodWell
John Contributes to Ansible
How to be an Ansible Contributor
• What Do I Know About Ansible?
• Read Some Docs
• Fork Ansible on Github
• SetupYour Development Environment
• Read Some Docs… again
• Create an Ansible Module
• Read Some Docs… again
• Read Some Docs… again and again!
• Submit a Pull Request
• Read Some Docs… again
• SyncYour Fork
• DeleteYour Branch
What Do I Know About Ansible?
What Do I know About Ansible?
• Not that Much … but it's Enough!
• I know how to
– Install Ansible
– Create/Run Ansible playbooks
– Run Ansible in very very very verbose mode
– Write Python Code (can be other languages, python is best)
– Use github.com and git
– Google Stuff
Read Some Docs
Read Some Docs
http://docs.ansible.com/ansible/devel/dev_guide/developing_modules_general.html
Read Some Docs
http://docs.ansible.com/ansible/devel/dev_guide/developing_modules_general.html
Someone wrote these Docs for you!
Don't make them Ugly Cry!
Read Some Docs
http://docs.ansible.com/ansible/devel/dev_guide/developing_modules_general.html
Someone wrote these Docs for you!
Don't make them Ugly Cry!
Fork Ansible on Github
Fork Ansible (docs say clone – I say fork)
• Forking a Github repository is
– Making a copy of that repository on github under YOUR account
– At that point in time
– Connected to the original but not updated by the original
• https://github.com/ansible/ansible
– Fork is not a git command and is done in the github.com interface
• hub – git from the command line - https://hub.github.com/
• hub is an extension to command-line git do everyday GitHub tasks without ever leaving the
terminal.
Fork Ansible (docs say clone – I say fork)
• Forking a Github repository is
– Making a copy of that repository on github under YOUR account
– At that point in time
– Connected to the original but not updated by the original
• https://github.com/ansible/ansible
– Fork is not a git command and is done in the github.com interface
• hub – git from the command line - https://hub.github.com/
• hub is an extension to command-line git do everyday GitHub tasks without ever leaving the
terminal.
Your ForkTheir Code
SetupYour Development
Environment
SetupYour Development Environment
• Clone YOUR Forked Code NOT the Ansible Code!
• Setup a PythonVirtual Environment in the ansible
Directory
– cd ansible
– python3 -m venv venv
• Activate theVirtual Environment
– . venv/bin/activate
• Install the Development Requirements
– pip install -r requirements.txt
• Run the Development Environment Setup Script
– . hacking/env-setup
SetupYour Development Environment
SetupYour Development Environment
SetupYour Development Environment
SetupYour Development Environment
SetupYour Development Environment
Read Some Docs … again
http://docs.ansible.com/ansible/devel/dev_guide/developing_modules_general.html
Read Some Docs … again
http://docs.ansible.com/ansible/devel/dev_guide/developing_modules_general.html
Create an Ansible Module
Create an Ansible Module
• Modules should be concise – "Do OneThingWell"
• Modules should not require a user to know all the
underlying options
• Modules should encompass much of the logic for
interacting with a resource
• Think CRUD
• I mean CUD (Create / Update / Delete)
Create an Ansible Module
• 'cd' to the desired directory
• Create a new file
• Use the "New module development"Template
• Test the Module
– Locally
– Playbook
• Run SanityTests
• Create UnitTests
Read Some Docs … again
http://docs.ansible.com/ansible/devel/dev_guide/developing_modules_general.html
Read Some Docs … again and again
http://docs.ansible.com/ansible/devel/dev_guide/developing_modules_general.html
Read Some Docs … again and again
http://docs.ansible.com/ansible/devel/dev_guide/developing_modules_general.html
Submit a Pull Request
Create an Ansible Module – Revised
• 'cd' to the desired directory
• Create feature branch
• Create a new file
• Use the "New module development"Template
• Test the Module
– Locally
– Playbook
• Run SanityTests
• Create UnitTests
• Commit and PushYOUR Code toYOUR feature branch
Submit a Pull Request
• Pull Requests can only be submitted against one
module
• One feature branch per Pull Request
– git checkout -b <feature branch name>  Create
– git branch  List branches
Read Some Docs … again
http://docs.ansible.com/ansible/devel/dev_guide/testing/sanity/index.html
Submit a Pull Request
Submit a Pull Request
Submit a Pull Request – After the Click
• Automated testing happens
• Your code will probably fail
– Fix it
– Commit it
– Push it
• AutomatedTesting Happens
– You do not need to submit a new Pull Request
Submit a Pull Request – Reviewers
• When your code is "Good" it will be merged… maybe.
• There are reviewers and maintainers that need to approve your code
– They will recommend changes
– They will hurt your feelings
– They will break you!
– They will help you be better!
• Make the changes that are requested
– Commit it
– Push it
• AutomatedTesting Happens
– You do not need to submit a new Pull Request
Submit a Pull Request
• Your Code PassesTests
• Your Code is marked shipit
• Your Code is Merged
• Wait you're not done yet!
SyncYour Fork
SyncYour Fork
git remote add upstream https://github.com/ansible/ansible.git
git remote –v  what are your remotes
Only need to add the upstream once
git fetch upstream  fetch the current ansible/devel
git checkout devel  checkout YOUR devel
git merge upstream/devel  merge ansible/devel to YOUR devel
git push origin devel  push YOUR devel to YOUR Ansible fork
https://help.github.com/articles/syncing-a-fork/
DeleteYour Branch
• git branch -d branch1 <--- locally
• git push origin :branch1 <--- remote
• Do it all over again for your next module
Links
• Blog - http://cs.co/sxsw2019
– “How to Contribute” video: https://www.youtube.com/watch?v=VAbnJcyIMYA&feature=youtu.be
• Matt Davis
– Ansible Module Development video - https://github.com/nitzmahone/ansible-modules-101
– Ansible Module Development 101 github - https://www.ansible.com/ansible-module-development-101
• Ansible Links:
– Ansible on Github - https://github.com/ansible/ansible
– Ansible module development: getting started -
https://docs.ansible.com/ansible/devel/dev_guide/developing_modules_general.html
– Testing Ansible - https://docs.ansible.com/ansible/devel/dev_guide/testing.html
• Learning
– DevNet Learning Labs an introduction - https://developer.cisco.com/learning/modules/sdx-ansible-intro
– DevNet Learning Labs a bunch of labs - https://developer.cisco.com/learning/modules?keywords=ansible
Got Questions? This is where I'm at!
jomcdono@cisco.com
@johnamcdonough
http://github.com/movinalot
@CiscoDevNet
facebook.com/ciscodevnet
http://github.com/CiscoDevNet
Thank you!

Weitere ähnliche Inhalte

Was ist angesagt?

DevNet @TAG - Spark & Tropo APIs - Milan/Rome May 2016
DevNet @TAG - Spark & Tropo APIs - Milan/Rome May 2016DevNet @TAG - Spark & Tropo APIs - Milan/Rome May 2016
DevNet @TAG - Spark & Tropo APIs - Milan/Rome May 2016Cisco DevNet
 
Cisco Spark and Tropo and the Programmable Web
Cisco Spark and Tropo and the Programmable WebCisco Spark and Tropo and the Programmable Web
Cisco Spark and Tropo and the Programmable WebCisco DevNet
 
Javascript Essentials - Cisco Live Barcelona 2019
Javascript Essentials - Cisco Live Barcelona 2019Javascript Essentials - Cisco Live Barcelona 2019
Javascript Essentials - Cisco Live Barcelona 2019Cisco DevNet
 
WAN Automation Engine API Deep Dive
WAN Automation Engine API Deep DiveWAN Automation Engine API Deep Dive
WAN Automation Engine API Deep DiveCisco DevNet
 
Webex Devices xAPI - DEVNET_2071 - Cisco Live - San Diego 2019
Webex Devices xAPI - DEVNET_2071 - Cisco Live - San Diego 2019Webex Devices xAPI - DEVNET_2071 - Cisco Live - San Diego 2019
Webex Devices xAPI - DEVNET_2071 - Cisco Live - San Diego 2019Cisco DevNet
 
NetDevOps for the Network Dude: How to get started with API's, Ansible and Py...
NetDevOps for the Network Dude: How to get started with API's, Ansible and Py...NetDevOps for the Network Dude: How to get started with API's, Ansible and Py...
NetDevOps for the Network Dude: How to get started with API's, Ansible and Py...Cisco DevNet
 
Webex APIs for Administrators - DEVNET_2610 - Cisco Live 2019
Webex APIs for Administrators - DEVNET_2610 - Cisco Live 2019Webex APIs for Administrators - DEVNET_2610 - Cisco Live 2019
Webex APIs for Administrators - DEVNET_2610 - Cisco Live 2019Cisco DevNet
 
Cisco's Open Device Programmability Strategy: Open Discussion
Cisco's Open Device Programmability Strategy: Open DiscussionCisco's Open Device Programmability Strategy: Open Discussion
Cisco's Open Device Programmability Strategy: Open DiscussionCisco DevNet
 
Net Devops Overview
Net Devops OverviewNet Devops Overview
Net Devops OverviewJoel W. King
 
Open Device Programmability: Hands-on Intro to RESTCONF (and a bit of NETCONF)
Open Device Programmability: Hands-on Intro to RESTCONF (and a bit of NETCONF)Open Device Programmability: Hands-on Intro to RESTCONF (and a bit of NETCONF)
Open Device Programmability: Hands-on Intro to RESTCONF (and a bit of NETCONF)Cisco DevNet
 
Infrastructure as Code for Network
Infrastructure as Code for NetworkInfrastructure as Code for Network
Infrastructure as Code for NetworkDamien Garros
 
Webex APIs for Admins - Cisco Live Orlando 2018 - DEVNET-3610
Webex APIs for Admins - Cisco Live Orlando 2018 - DEVNET-3610Webex APIs for Admins - Cisco Live Orlando 2018 - DEVNET-3610
Webex APIs for Admins - Cisco Live Orlando 2018 - DEVNET-3610Cisco DevNet
 
Webex Teams Widgets Technical Drill down - Cisco Live Orlando 2018 - DEVNET-3891
Webex Teams Widgets Technical Drill down - Cisco Live Orlando 2018 - DEVNET-3891Webex Teams Widgets Technical Drill down - Cisco Live Orlando 2018 - DEVNET-3891
Webex Teams Widgets Technical Drill down - Cisco Live Orlando 2018 - DEVNET-3891Cisco DevNet
 
Building a WiFi Hotspot with NodeJS: Cisco Meraki - ExCap API
Building a WiFi Hotspot with NodeJS: Cisco Meraki - ExCap APIBuilding a WiFi Hotspot with NodeJS: Cisco Meraki - ExCap API
Building a WiFi Hotspot with NodeJS: Cisco Meraki - ExCap APICisco DevNet
 
Chatbots 101: design, code, deploy - Cisco Live Orlando 2018 - DEVNET-2896
Chatbots 101: design, code, deploy - Cisco Live Orlando 2018 - DEVNET-2896Chatbots 101: design, code, deploy - Cisco Live Orlando 2018 - DEVNET-2896
Chatbots 101: design, code, deploy - Cisco Live Orlando 2018 - DEVNET-2896Cisco DevNet
 
DevOPS training - Day 2/2
DevOPS training - Day 2/2DevOPS training - Day 2/2
DevOPS training - Day 2/2Vincent Mercier
 
The Future of Security and Productivity in Our Newly Remote World
The Future of Security and Productivity in Our Newly Remote WorldThe Future of Security and Productivity in Our Newly Remote World
The Future of Security and Productivity in Our Newly Remote WorldDevOps.com
 
Advanced coding & deployment for Cisco Video Devices - CL20B - DEVNET-3244
Advanced coding & deployment for Cisco Video Devices - CL20B - DEVNET-3244Advanced coding & deployment for Cisco Video Devices - CL20B - DEVNET-3244
Advanced coding & deployment for Cisco Video Devices - CL20B - DEVNET-3244Cisco DevNet
 
Meeting rooms are talking! are you listening?
Meeting rooms are talking! are you listening?Meeting rooms are talking! are you listening?
Meeting rooms are talking! are you listening?Cisco DevNet
 
10 things you need to know to deliver a successful Alfresco project
10 things you need to know to deliver a successful Alfresco project10 things you need to know to deliver a successful Alfresco project
10 things you need to know to deliver a successful Alfresco projectSymphony Software Foundation
 

Was ist angesagt? (20)

DevNet @TAG - Spark & Tropo APIs - Milan/Rome May 2016
DevNet @TAG - Spark & Tropo APIs - Milan/Rome May 2016DevNet @TAG - Spark & Tropo APIs - Milan/Rome May 2016
DevNet @TAG - Spark & Tropo APIs - Milan/Rome May 2016
 
Cisco Spark and Tropo and the Programmable Web
Cisco Spark and Tropo and the Programmable WebCisco Spark and Tropo and the Programmable Web
Cisco Spark and Tropo and the Programmable Web
 
Javascript Essentials - Cisco Live Barcelona 2019
Javascript Essentials - Cisco Live Barcelona 2019Javascript Essentials - Cisco Live Barcelona 2019
Javascript Essentials - Cisco Live Barcelona 2019
 
WAN Automation Engine API Deep Dive
WAN Automation Engine API Deep DiveWAN Automation Engine API Deep Dive
WAN Automation Engine API Deep Dive
 
Webex Devices xAPI - DEVNET_2071 - Cisco Live - San Diego 2019
Webex Devices xAPI - DEVNET_2071 - Cisco Live - San Diego 2019Webex Devices xAPI - DEVNET_2071 - Cisco Live - San Diego 2019
Webex Devices xAPI - DEVNET_2071 - Cisco Live - San Diego 2019
 
NetDevOps for the Network Dude: How to get started with API's, Ansible and Py...
NetDevOps for the Network Dude: How to get started with API's, Ansible and Py...NetDevOps for the Network Dude: How to get started with API's, Ansible and Py...
NetDevOps for the Network Dude: How to get started with API's, Ansible and Py...
 
Webex APIs for Administrators - DEVNET_2610 - Cisco Live 2019
Webex APIs for Administrators - DEVNET_2610 - Cisco Live 2019Webex APIs for Administrators - DEVNET_2610 - Cisco Live 2019
Webex APIs for Administrators - DEVNET_2610 - Cisco Live 2019
 
Cisco's Open Device Programmability Strategy: Open Discussion
Cisco's Open Device Programmability Strategy: Open DiscussionCisco's Open Device Programmability Strategy: Open Discussion
Cisco's Open Device Programmability Strategy: Open Discussion
 
Net Devops Overview
Net Devops OverviewNet Devops Overview
Net Devops Overview
 
Open Device Programmability: Hands-on Intro to RESTCONF (and a bit of NETCONF)
Open Device Programmability: Hands-on Intro to RESTCONF (and a bit of NETCONF)Open Device Programmability: Hands-on Intro to RESTCONF (and a bit of NETCONF)
Open Device Programmability: Hands-on Intro to RESTCONF (and a bit of NETCONF)
 
Infrastructure as Code for Network
Infrastructure as Code for NetworkInfrastructure as Code for Network
Infrastructure as Code for Network
 
Webex APIs for Admins - Cisco Live Orlando 2018 - DEVNET-3610
Webex APIs for Admins - Cisco Live Orlando 2018 - DEVNET-3610Webex APIs for Admins - Cisco Live Orlando 2018 - DEVNET-3610
Webex APIs for Admins - Cisco Live Orlando 2018 - DEVNET-3610
 
Webex Teams Widgets Technical Drill down - Cisco Live Orlando 2018 - DEVNET-3891
Webex Teams Widgets Technical Drill down - Cisco Live Orlando 2018 - DEVNET-3891Webex Teams Widgets Technical Drill down - Cisco Live Orlando 2018 - DEVNET-3891
Webex Teams Widgets Technical Drill down - Cisco Live Orlando 2018 - DEVNET-3891
 
Building a WiFi Hotspot with NodeJS: Cisco Meraki - ExCap API
Building a WiFi Hotspot with NodeJS: Cisco Meraki - ExCap APIBuilding a WiFi Hotspot with NodeJS: Cisco Meraki - ExCap API
Building a WiFi Hotspot with NodeJS: Cisco Meraki - ExCap API
 
Chatbots 101: design, code, deploy - Cisco Live Orlando 2018 - DEVNET-2896
Chatbots 101: design, code, deploy - Cisco Live Orlando 2018 - DEVNET-2896Chatbots 101: design, code, deploy - Cisco Live Orlando 2018 - DEVNET-2896
Chatbots 101: design, code, deploy - Cisco Live Orlando 2018 - DEVNET-2896
 
DevOPS training - Day 2/2
DevOPS training - Day 2/2DevOPS training - Day 2/2
DevOPS training - Day 2/2
 
The Future of Security and Productivity in Our Newly Remote World
The Future of Security and Productivity in Our Newly Remote WorldThe Future of Security and Productivity in Our Newly Remote World
The Future of Security and Productivity in Our Newly Remote World
 
Advanced coding & deployment for Cisco Video Devices - CL20B - DEVNET-3244
Advanced coding & deployment for Cisco Video Devices - CL20B - DEVNET-3244Advanced coding & deployment for Cisco Video Devices - CL20B - DEVNET-3244
Advanced coding & deployment for Cisco Video Devices - CL20B - DEVNET-3244
 
Meeting rooms are talking! are you listening?
Meeting rooms are talking! are you listening?Meeting rooms are talking! are you listening?
Meeting rooms are talking! are you listening?
 
10 things you need to know to deliver a successful Alfresco project
10 things you need to know to deliver a successful Alfresco project10 things you need to know to deliver a successful Alfresco project
10 things you need to know to deliver a successful Alfresco project
 

Ähnlich wie How to Contribute to Ansible

Hacking on WildFly 9
Hacking on WildFly 9Hacking on WildFly 9
Hacking on WildFly 9JBUG London
 
Continuous Integration with Open Source Tools - PHPUgFfm 2014-11-20
Continuous Integration with Open Source Tools - PHPUgFfm 2014-11-20Continuous Integration with Open Source Tools - PHPUgFfm 2014-11-20
Continuous Integration with Open Source Tools - PHPUgFfm 2014-11-20Michael Lihs
 
'Intro to Infrastructure as Code' - DevOps Belfast
'Intro to Infrastructure as Code' - DevOps Belfast'Intro to Infrastructure as Code' - DevOps Belfast
'Intro to Infrastructure as Code' - DevOps BelfastJohn Fitzpatrick
 
Habitat Workshop at Velocity London 2017
Habitat Workshop at Velocity London 2017Habitat Workshop at Velocity London 2017
Habitat Workshop at Velocity London 2017Mandi Walls
 
Github for Serious Business Professional
Github for Serious Business ProfessionalGithub for Serious Business Professional
Github for Serious Business Professionalzwheller
 
Application Deployment at UC Riverside
Application Deployment at UC RiversideApplication Deployment at UC Riverside
Application Deployment at UC RiversideMichael Kennedy
 
Staging and Deployment
Staging and DeploymentStaging and Deployment
Staging and Deploymentheyrocker
 
Introduction to github using Egit
Introduction to github using EgitIntroduction to github using Egit
Introduction to github using Egitmatz_twt
 
Untangling fall2017 week2
Untangling fall2017 week2Untangling fall2017 week2
Untangling fall2017 week2Derek Jacoby
 
Untangling fall2017 week2_try2
Untangling fall2017 week2_try2Untangling fall2017 week2_try2
Untangling fall2017 week2_try2Derek Jacoby
 
ASP.NET 5 auf Raspberry PI & docker
ASP.NET 5 auf Raspberry PI & dockerASP.NET 5 auf Raspberry PI & docker
ASP.NET 5 auf Raspberry PI & dockerJürgen Gutsch
 
Puppet Camp New York 2014: Streamlining Puppet Development Workflow
Puppet Camp New York 2014: Streamlining Puppet Development Workflow Puppet Camp New York 2014: Streamlining Puppet Development Workflow
Puppet Camp New York 2014: Streamlining Puppet Development Workflow Puppet
 
Steamlining your puppet development workflow
Steamlining your puppet development workflowSteamlining your puppet development workflow
Steamlining your puppet development workflowTomas Doran
 
Collaborative development with git
Collaborative development with gitCollaborative development with git
Collaborative development with gitJoseluis Laso
 
habitat at docker bud
habitat at docker budhabitat at docker bud
habitat at docker budMandi Walls
 
Automated Deployment and Configuration Engines. Ansible
Automated Deployment and Configuration Engines. AnsibleAutomated Deployment and Configuration Engines. Ansible
Automated Deployment and Configuration Engines. AnsibleAlberto Molina Coballes
 

Ähnlich wie How to Contribute to Ansible (20)

Hacking on WildFly 9
Hacking on WildFly 9Hacking on WildFly 9
Hacking on WildFly 9
 
Hacking on WildFly 9
Hacking on WildFly 9Hacking on WildFly 9
Hacking on WildFly 9
 
Continuous Integration with Open Source Tools - PHPUgFfm 2014-11-20
Continuous Integration with Open Source Tools - PHPUgFfm 2014-11-20Continuous Integration with Open Source Tools - PHPUgFfm 2014-11-20
Continuous Integration with Open Source Tools - PHPUgFfm 2014-11-20
 
'Intro to Infrastructure as Code' - DevOps Belfast
'Intro to Infrastructure as Code' - DevOps Belfast'Intro to Infrastructure as Code' - DevOps Belfast
'Intro to Infrastructure as Code' - DevOps Belfast
 
ConcourseCi overview
ConcourseCi  overviewConcourseCi  overview
ConcourseCi overview
 
CICD_1670665418.pdf
CICD_1670665418.pdfCICD_1670665418.pdf
CICD_1670665418.pdf
 
Habitat Workshop at Velocity London 2017
Habitat Workshop at Velocity London 2017Habitat Workshop at Velocity London 2017
Habitat Workshop at Velocity London 2017
 
Github for Serious Business Professional
Github for Serious Business ProfessionalGithub for Serious Business Professional
Github for Serious Business Professional
 
Application Deployment at UC Riverside
Application Deployment at UC RiversideApplication Deployment at UC Riverside
Application Deployment at UC Riverside
 
Staging and Deployment
Staging and DeploymentStaging and Deployment
Staging and Deployment
 
Git preso to valtech cfml team
Git preso to valtech cfml teamGit preso to valtech cfml team
Git preso to valtech cfml team
 
Introduction to github using Egit
Introduction to github using EgitIntroduction to github using Egit
Introduction to github using Egit
 
Untangling fall2017 week2
Untangling fall2017 week2Untangling fall2017 week2
Untangling fall2017 week2
 
Untangling fall2017 week2_try2
Untangling fall2017 week2_try2Untangling fall2017 week2_try2
Untangling fall2017 week2_try2
 
ASP.NET 5 auf Raspberry PI & docker
ASP.NET 5 auf Raspberry PI & dockerASP.NET 5 auf Raspberry PI & docker
ASP.NET 5 auf Raspberry PI & docker
 
Puppet Camp New York 2014: Streamlining Puppet Development Workflow
Puppet Camp New York 2014: Streamlining Puppet Development Workflow Puppet Camp New York 2014: Streamlining Puppet Development Workflow
Puppet Camp New York 2014: Streamlining Puppet Development Workflow
 
Steamlining your puppet development workflow
Steamlining your puppet development workflowSteamlining your puppet development workflow
Steamlining your puppet development workflow
 
Collaborative development with git
Collaborative development with gitCollaborative development with git
Collaborative development with git
 
habitat at docker bud
habitat at docker budhabitat at docker bud
habitat at docker bud
 
Automated Deployment and Configuration Engines. Ansible
Automated Deployment and Configuration Engines. AnsibleAutomated Deployment and Configuration Engines. Ansible
Automated Deployment and Configuration Engines. Ansible
 

Mehr von Cisco DevNet

Application Visibility and Experience through Flexible Netflow
Application Visibility and Experience through Flexible NetflowApplication Visibility and Experience through Flexible Netflow
Application Visibility and Experience through Flexible NetflowCisco DevNet
 
NETCONF & YANG Enablement of Network Devices
NETCONF & YANG Enablement of Network DevicesNETCONF & YANG Enablement of Network Devices
NETCONF & YANG Enablement of Network DevicesCisco DevNet
 
UCS Management APIs A Technical Deep Dive
UCS Management APIs A Technical Deep DiveUCS Management APIs A Technical Deep Dive
UCS Management APIs A Technical Deep DiveCisco DevNet
 
DevNet Express - Spark & Tropo API - Lisbon May 2016
DevNet Express - Spark & Tropo API - Lisbon May 2016DevNet Express - Spark & Tropo API - Lisbon May 2016
DevNet Express - Spark & Tropo API - Lisbon May 2016Cisco DevNet
 
Choosing PaaS: Cisco and Open Source Options: an overview
Choosing PaaS:  Cisco and Open Source Options: an overviewChoosing PaaS:  Cisco and Open Source Options: an overview
Choosing PaaS: Cisco and Open Source Options: an overviewCisco DevNet
 
Doing Business with Tropo
Doing Business with TropoDoing Business with Tropo
Doing Business with TropoCisco DevNet
 
Introduction to the DevNet Sandbox and IVT
Introduction to the DevNet Sandbox and IVTIntroduction to the DevNet Sandbox and IVT
Introduction to the DevNet Sandbox and IVTCisco DevNet
 
Introduction to Fog
Introduction to FogIntroduction to Fog
Introduction to FogCisco DevNet
 
CSTA - Cisco Security Technical Alliances, New Ecosystem Program Built on the...
CSTA - Cisco Security Technical Alliances, New Ecosystem Program Built on the...CSTA - Cisco Security Technical Alliances, New Ecosystem Program Built on the...
CSTA - Cisco Security Technical Alliances, New Ecosystem Program Built on the...Cisco DevNet
 
Introduction to ACI APIs
Introduction to ACI APIsIntroduction to ACI APIs
Introduction to ACI APIsCisco DevNet
 
Flare: an overview
Flare: an overviewFlare: an overview
Flare: an overviewCisco DevNet
 
Enabling Fast IT using Containers, Microservices and DAVROS models: an overview
Enabling Fast IT using Containers, Microservices and DAVROS models: an overviewEnabling Fast IT using Containers, Microservices and DAVROS models: an overview
Enabling Fast IT using Containers, Microservices and DAVROS models: an overviewCisco DevNet
 
Cisco Managed Private Cloud in Your Data Center: Public cloud experience on ...
Cisco Managed Private Cloud in Your Data Center:  Public cloud experience on ...Cisco Managed Private Cloud in Your Data Center:  Public cloud experience on ...
Cisco Managed Private Cloud in Your Data Center: Public cloud experience on ...Cisco DevNet
 
Starting the DevOps Train
Starting the DevOps TrainStarting the DevOps Train
Starting the DevOps TrainCisco DevNet
 
Getting Started with OpenStack
Getting Started with OpenStackGetting Started with OpenStack
Getting Started with OpenStackCisco DevNet
 

Mehr von Cisco DevNet (15)

Application Visibility and Experience through Flexible Netflow
Application Visibility and Experience through Flexible NetflowApplication Visibility and Experience through Flexible Netflow
Application Visibility and Experience through Flexible Netflow
 
NETCONF & YANG Enablement of Network Devices
NETCONF & YANG Enablement of Network DevicesNETCONF & YANG Enablement of Network Devices
NETCONF & YANG Enablement of Network Devices
 
UCS Management APIs A Technical Deep Dive
UCS Management APIs A Technical Deep DiveUCS Management APIs A Technical Deep Dive
UCS Management APIs A Technical Deep Dive
 
DevNet Express - Spark & Tropo API - Lisbon May 2016
DevNet Express - Spark & Tropo API - Lisbon May 2016DevNet Express - Spark & Tropo API - Lisbon May 2016
DevNet Express - Spark & Tropo API - Lisbon May 2016
 
Choosing PaaS: Cisco and Open Source Options: an overview
Choosing PaaS:  Cisco and Open Source Options: an overviewChoosing PaaS:  Cisco and Open Source Options: an overview
Choosing PaaS: Cisco and Open Source Options: an overview
 
Doing Business with Tropo
Doing Business with TropoDoing Business with Tropo
Doing Business with Tropo
 
Introduction to the DevNet Sandbox and IVT
Introduction to the DevNet Sandbox and IVTIntroduction to the DevNet Sandbox and IVT
Introduction to the DevNet Sandbox and IVT
 
Introduction to Fog
Introduction to FogIntroduction to Fog
Introduction to Fog
 
CSTA - Cisco Security Technical Alliances, New Ecosystem Program Built on the...
CSTA - Cisco Security Technical Alliances, New Ecosystem Program Built on the...CSTA - Cisco Security Technical Alliances, New Ecosystem Program Built on the...
CSTA - Cisco Security Technical Alliances, New Ecosystem Program Built on the...
 
Introduction to ACI APIs
Introduction to ACI APIsIntroduction to ACI APIs
Introduction to ACI APIs
 
Flare: an overview
Flare: an overviewFlare: an overview
Flare: an overview
 
Enabling Fast IT using Containers, Microservices and DAVROS models: an overview
Enabling Fast IT using Containers, Microservices and DAVROS models: an overviewEnabling Fast IT using Containers, Microservices and DAVROS models: an overview
Enabling Fast IT using Containers, Microservices and DAVROS models: an overview
 
Cisco Managed Private Cloud in Your Data Center: Public cloud experience on ...
Cisco Managed Private Cloud in Your Data Center:  Public cloud experience on ...Cisco Managed Private Cloud in Your Data Center:  Public cloud experience on ...
Cisco Managed Private Cloud in Your Data Center: Public cloud experience on ...
 
Starting the DevOps Train
Starting the DevOps TrainStarting the DevOps Train
Starting the DevOps Train
 
Getting Started with OpenStack
Getting Started with OpenStackGetting Started with OpenStack
Getting Started with OpenStack
 

Kürzlich hochgeladen

Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantAxelRicardoTrocheRiq
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...soniya singh
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
 
Introduction to Decentralized Applications (dApps)
Introduction to Decentralized Applications (dApps)Introduction to Decentralized Applications (dApps)
Introduction to Decentralized Applications (dApps)Intelisync
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...Christina Lin
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...gurkirankumar98700
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityNeo4j
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfjoe51371421
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptkotipi9215
 
Engage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyEngage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyFrank van der Linden
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)OPEN KNOWLEDGE GmbH
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Modelsaagamshah0812
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - InfographicHr365.us smith
 

Kürzlich hochgeladen (20)

Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service Consultant
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
Introduction to Decentralized Applications (dApps)
Introduction to Decentralized Applications (dApps)Introduction to Decentralized Applications (dApps)
Introduction to Decentralized Applications (dApps)
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered Sustainability
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdf
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.ppt
 
Engage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyEngage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The Ugly
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - Infographic
 

How to Contribute to Ansible

  • 1. How to be an Ansible Contributor Step – by – Step Developer Advocate, Cisco @johnamcdonough John McDonough
  • 2. John McDonough Developer Advocate, Cisco John Works for Cisco DevNet JohnWrites Code JohnTalks about Code JohnTalks about Writing Code John Writes OK Code andTalks Pretty GoodWell John Contributes to Ansible
  • 3. How to be an Ansible Contributor • What Do I Know About Ansible? • Read Some Docs • Fork Ansible on Github • SetupYour Development Environment • Read Some Docs… again • Create an Ansible Module • Read Some Docs… again • Read Some Docs… again and again! • Submit a Pull Request • Read Some Docs… again • SyncYour Fork • DeleteYour Branch
  • 4. What Do I Know About Ansible?
  • 5. What Do I know About Ansible? • Not that Much … but it's Enough! • I know how to – Install Ansible – Create/Run Ansible playbooks – Run Ansible in very very very verbose mode – Write Python Code (can be other languages, python is best) – Use github.com and git – Google Stuff
  • 10. Fork Ansible on Github
  • 11. Fork Ansible (docs say clone – I say fork) • Forking a Github repository is – Making a copy of that repository on github under YOUR account – At that point in time – Connected to the original but not updated by the original • https://github.com/ansible/ansible – Fork is not a git command and is done in the github.com interface • hub – git from the command line - https://hub.github.com/ • hub is an extension to command-line git do everyday GitHub tasks without ever leaving the terminal.
  • 12. Fork Ansible (docs say clone – I say fork) • Forking a Github repository is – Making a copy of that repository on github under YOUR account – At that point in time – Connected to the original but not updated by the original • https://github.com/ansible/ansible – Fork is not a git command and is done in the github.com interface • hub – git from the command line - https://hub.github.com/ • hub is an extension to command-line git do everyday GitHub tasks without ever leaving the terminal. Your ForkTheir Code
  • 14. SetupYour Development Environment • Clone YOUR Forked Code NOT the Ansible Code! • Setup a PythonVirtual Environment in the ansible Directory – cd ansible – python3 -m venv venv • Activate theVirtual Environment – . venv/bin/activate • Install the Development Requirements – pip install -r requirements.txt • Run the Development Environment Setup Script – . hacking/env-setup
  • 20. Read Some Docs … again http://docs.ansible.com/ansible/devel/dev_guide/developing_modules_general.html
  • 21. Read Some Docs … again http://docs.ansible.com/ansible/devel/dev_guide/developing_modules_general.html
  • 23. Create an Ansible Module • Modules should be concise – "Do OneThingWell" • Modules should not require a user to know all the underlying options • Modules should encompass much of the logic for interacting with a resource • Think CRUD • I mean CUD (Create / Update / Delete)
  • 24. Create an Ansible Module • 'cd' to the desired directory • Create a new file • Use the "New module development"Template • Test the Module – Locally – Playbook • Run SanityTests • Create UnitTests
  • 25. Read Some Docs … again http://docs.ansible.com/ansible/devel/dev_guide/developing_modules_general.html
  • 26. Read Some Docs … again and again http://docs.ansible.com/ansible/devel/dev_guide/developing_modules_general.html
  • 27. Read Some Docs … again and again http://docs.ansible.com/ansible/devel/dev_guide/developing_modules_general.html
  • 28. Submit a Pull Request
  • 29. Create an Ansible Module – Revised • 'cd' to the desired directory • Create feature branch • Create a new file • Use the "New module development"Template • Test the Module – Locally – Playbook • Run SanityTests • Create UnitTests • Commit and PushYOUR Code toYOUR feature branch
  • 30. Submit a Pull Request • Pull Requests can only be submitted against one module • One feature branch per Pull Request – git checkout -b <feature branch name>  Create – git branch  List branches
  • 31. Read Some Docs … again http://docs.ansible.com/ansible/devel/dev_guide/testing/sanity/index.html
  • 32. Submit a Pull Request
  • 33. Submit a Pull Request
  • 34. Submit a Pull Request – After the Click • Automated testing happens • Your code will probably fail – Fix it – Commit it – Push it • AutomatedTesting Happens – You do not need to submit a new Pull Request
  • 35. Submit a Pull Request – Reviewers • When your code is "Good" it will be merged… maybe. • There are reviewers and maintainers that need to approve your code – They will recommend changes – They will hurt your feelings – They will break you! – They will help you be better! • Make the changes that are requested – Commit it – Push it • AutomatedTesting Happens – You do not need to submit a new Pull Request
  • 36. Submit a Pull Request • Your Code PassesTests • Your Code is marked shipit • Your Code is Merged • Wait you're not done yet!
  • 38. SyncYour Fork git remote add upstream https://github.com/ansible/ansible.git git remote –v  what are your remotes Only need to add the upstream once git fetch upstream  fetch the current ansible/devel git checkout devel  checkout YOUR devel git merge upstream/devel  merge ansible/devel to YOUR devel git push origin devel  push YOUR devel to YOUR Ansible fork https://help.github.com/articles/syncing-a-fork/
  • 39. DeleteYour Branch • git branch -d branch1 <--- locally • git push origin :branch1 <--- remote • Do it all over again for your next module
  • 40. Links • Blog - http://cs.co/sxsw2019 – “How to Contribute” video: https://www.youtube.com/watch?v=VAbnJcyIMYA&feature=youtu.be • Matt Davis – Ansible Module Development video - https://github.com/nitzmahone/ansible-modules-101 – Ansible Module Development 101 github - https://www.ansible.com/ansible-module-development-101 • Ansible Links: – Ansible on Github - https://github.com/ansible/ansible – Ansible module development: getting started - https://docs.ansible.com/ansible/devel/dev_guide/developing_modules_general.html – Testing Ansible - https://docs.ansible.com/ansible/devel/dev_guide/testing.html • Learning – DevNet Learning Labs an introduction - https://developer.cisco.com/learning/modules/sdx-ansible-intro – DevNet Learning Labs a bunch of labs - https://developer.cisco.com/learning/modules?keywords=ansible
  • 41. Got Questions? This is where I'm at! jomcdono@cisco.com @johnamcdonough http://github.com/movinalot @CiscoDevNet facebook.com/ciscodevnet http://github.com/CiscoDevNet