Ansible can be used for testing infrastructure, applications, and functionality. It provides modules like assert and wait_for that allow validating conditions and waiting for resources. Ansible roles, loops, and tags can structure test cases. Rolling deployments can integrate testing by deploying, validating, and adding instances behind a load balancer. While Ansible configures declaratively, additional steps like assertions allow verifying functionality before continuing.
Meetup talk on my experiments with ansible-container.
Use ansible-container to provision docker containers using ansible, then ship them to kubernetes or OpenShift
I presented this slides at the Ansible Munich Meetup on Feb 22cd 2016. You can find the recording of the talk here: https://www.youtube.com/watch?v=B7K1ETPyzoQ (starts at 1:18). This talk is giving a 101 level introduction on developing Ansible Module in Python.
Ansible 2.0 - How to use Ansible to automate your applications in AWS.Idan Tohami
- How to use Ansible to automate your applications in AWS.
- What is Ansible and why is it different?
- How to control cloud deployments securely
- How to control AWS resources using dynamic inventory and tags.
Meetup talk on my experiments with ansible-container.
Use ansible-container to provision docker containers using ansible, then ship them to kubernetes or OpenShift
I presented this slides at the Ansible Munich Meetup on Feb 22cd 2016. You can find the recording of the talk here: https://www.youtube.com/watch?v=B7K1ETPyzoQ (starts at 1:18). This talk is giving a 101 level introduction on developing Ansible Module in Python.
Ansible 2.0 - How to use Ansible to automate your applications in AWS.Idan Tohami
- How to use Ansible to automate your applications in AWS.
- What is Ansible and why is it different?
- How to control cloud deployments securely
- How to control AWS resources using dynamic inventory and tags.
A revamped version of the Ansible intro talk from February 2015, brought up-to-date for the January Ansible meetup in Berlin.
Join our group: https://www.meetup.com/Ansible-Berlin
This Presentation is an introducing to the IT automation environment, starting from a sys admin point of view.
The purpose of these tools is to help in troubleshooting and handling an heterogeneous it environment to ensure availability and reliability.
A presentation delivered by Arctiq, onsite in Toronto, on Mar 1, 2017. The presentation discusses Ansible as an automation tool for Linux, Windows, and network devices. Reach out if you would like more information www.arctiq.ca
Monitor-Driven Development Using AnsibleItamar Hassin
Discusses an XP approach to writing Ansible scripts: Start with a failing test and write code around it to make it pass. Write monitoring code, let it drive your Ansible code to have a functioning server. I use ServerSpec and Cucumber as the monitoring code. Broader subject is that Ansible code should be treated as regular application code - use TDD, SCM, CI and pairing to create a single delivery team consisting of devs and sysadmins as a delivery team.
What Is Ansible? | How Ansible Works? | Ansible Tutorial For Beginners | DevO...Simplilearn
This presentation on Ansible will help you understand why Ansible is needed, what is Ansible, Ansible as a pull configuration tool, Ansible architecture, Ansible playbook, Ansible inventory, how Ansible works, Ansible tower and you will also see a use case on how Hootsuite used Ansible. Increasing team productivity and improving business outcomes have now become easy with Ansible. Ansible is a simple, popular, agent-free tool in the automation domain. Ansible is a tool that allows you to create and control three key areas within the operations environment of software development lifecycle. The first one is IT automation which allows you to write instructions to automate the IT professional's work that you would typically do manually in the past, the second is configuration management which allows you to maintain consistency of all systems in the infrastructure and the third is automatic deployment which allows you to deploy applications automatically on a variety of environments. Now let us get started and understand Ansible and it's architecture.
Below topics are explained in this Ansible presentation:
1. Why Ansible?
2. What is Ansible?
3. Ansible - Pull configuration tool
4. Ansible architecture
5. Playbook
6. Inventory
7. Working of Ansible
8. Ansible tower
9. Use case by Hootsuite
Simplilearn's DevOps Certification Training Course will prepare you for a career in DevOps, the fast-growing field that bridges the gap between software developers and operations. You’ll become en expert in the principles of continuous development and deployment, automation of configuration management, inter-team collaboration and IT service agility, using modern DevOps tools such as Git, Docker, Jenkins, Puppet and Nagios. DevOps jobs are highly paid and in great demand, so start on your path today.
Who should take this course?
DevOps career opportunities are thriving worldwide. DevOps was featured as one of the 11 best jobs in America for 2017, according to CBS News, and data from Payscale.com shows that DevOps Managers earn as much as $122,234 per year, with DevOps engineers making as much as $151,461. DevOps jobs are the third-highest tech role ranked by employer demand on Indeed.com but have the second-highest talent deficit.
1. This DevOps training course will be of benefit the following professional roles:
2. Software Developers
3. Technical Project Managers
4. Architects
5. Operations Support
6. Deployment engineers
7. IT managers
8. Development managers
Learn more at: https://www.simplilearn.com/
Blue/Green deployments have been an important, if rarely implemented, technique in the Continuous Delivery playbook for years. Their aim is simple: provision, deploy, test — and optionally roll-back — your application before it's served to the public. Betterment's deployment architecture takes a similar, but more straightforward approach, accomplishing the important goals sought out by Blue/Green practitioners. Dubbed 'Cyan' (a mixture of Blue/Green), Betterment uses Ansible to provision new instances, push the latest artifacts to them, and ensure that they're healthy before marking them ready for production. All this ensures fast, stable, zero-downtime rollout with minimal human interaction. We'll discuss Betterment's philosophical approach to shipping new code and then dive into the nitty-gritty Ansible that powers the whole thing.
utPLSQL offers a unit testing API for PL/SQL that is modeled on the xUnit approach. This is an old slide deck on utPLSQL so my apologies for any inconsistencies with the current utility. Note: while I created the original utPLSQL code base, I am not actively working on utPLSQL at this time. Check out github.com/utplsql for the code and project details.
A revamped version of the Ansible intro talk from February 2015, brought up-to-date for the January Ansible meetup in Berlin.
Join our group: https://www.meetup.com/Ansible-Berlin
This Presentation is an introducing to the IT automation environment, starting from a sys admin point of view.
The purpose of these tools is to help in troubleshooting and handling an heterogeneous it environment to ensure availability and reliability.
A presentation delivered by Arctiq, onsite in Toronto, on Mar 1, 2017. The presentation discusses Ansible as an automation tool for Linux, Windows, and network devices. Reach out if you would like more information www.arctiq.ca
Monitor-Driven Development Using AnsibleItamar Hassin
Discusses an XP approach to writing Ansible scripts: Start with a failing test and write code around it to make it pass. Write monitoring code, let it drive your Ansible code to have a functioning server. I use ServerSpec and Cucumber as the monitoring code. Broader subject is that Ansible code should be treated as regular application code - use TDD, SCM, CI and pairing to create a single delivery team consisting of devs and sysadmins as a delivery team.
What Is Ansible? | How Ansible Works? | Ansible Tutorial For Beginners | DevO...Simplilearn
This presentation on Ansible will help you understand why Ansible is needed, what is Ansible, Ansible as a pull configuration tool, Ansible architecture, Ansible playbook, Ansible inventory, how Ansible works, Ansible tower and you will also see a use case on how Hootsuite used Ansible. Increasing team productivity and improving business outcomes have now become easy with Ansible. Ansible is a simple, popular, agent-free tool in the automation domain. Ansible is a tool that allows you to create and control three key areas within the operations environment of software development lifecycle. The first one is IT automation which allows you to write instructions to automate the IT professional's work that you would typically do manually in the past, the second is configuration management which allows you to maintain consistency of all systems in the infrastructure and the third is automatic deployment which allows you to deploy applications automatically on a variety of environments. Now let us get started and understand Ansible and it's architecture.
Below topics are explained in this Ansible presentation:
1. Why Ansible?
2. What is Ansible?
3. Ansible - Pull configuration tool
4. Ansible architecture
5. Playbook
6. Inventory
7. Working of Ansible
8. Ansible tower
9. Use case by Hootsuite
Simplilearn's DevOps Certification Training Course will prepare you for a career in DevOps, the fast-growing field that bridges the gap between software developers and operations. You’ll become en expert in the principles of continuous development and deployment, automation of configuration management, inter-team collaboration and IT service agility, using modern DevOps tools such as Git, Docker, Jenkins, Puppet and Nagios. DevOps jobs are highly paid and in great demand, so start on your path today.
Who should take this course?
DevOps career opportunities are thriving worldwide. DevOps was featured as one of the 11 best jobs in America for 2017, according to CBS News, and data from Payscale.com shows that DevOps Managers earn as much as $122,234 per year, with DevOps engineers making as much as $151,461. DevOps jobs are the third-highest tech role ranked by employer demand on Indeed.com but have the second-highest talent deficit.
1. This DevOps training course will be of benefit the following professional roles:
2. Software Developers
3. Technical Project Managers
4. Architects
5. Operations Support
6. Deployment engineers
7. IT managers
8. Development managers
Learn more at: https://www.simplilearn.com/
Blue/Green deployments have been an important, if rarely implemented, technique in the Continuous Delivery playbook for years. Their aim is simple: provision, deploy, test — and optionally roll-back — your application before it's served to the public. Betterment's deployment architecture takes a similar, but more straightforward approach, accomplishing the important goals sought out by Blue/Green practitioners. Dubbed 'Cyan' (a mixture of Blue/Green), Betterment uses Ansible to provision new instances, push the latest artifacts to them, and ensure that they're healthy before marking them ready for production. All this ensures fast, stable, zero-downtime rollout with minimal human interaction. We'll discuss Betterment's philosophical approach to shipping new code and then dive into the nitty-gritty Ansible that powers the whole thing.
utPLSQL offers a unit testing API for PL/SQL that is modeled on the xUnit approach. This is an old slide deck on utPLSQL so my apologies for any inconsistencies with the current utility. Note: while I created the original utPLSQL code base, I am not actively working on utPLSQL at this time. Check out github.com/utplsql for the code and project details.
Developer Tests - Things to Know (Vilnius JUG)vilniusjug
There are many great talks that discuss challenges developers face when writing software tests. In this talk let's look at test design problems that may seem to be simple but yet fundamentally important and often misunderstood even by experienced programmers.
A brief introduction to javascript test driven development (TDD) towards several point of views by using qUnit, Karma & Jasmine, NodeJS tape module and custom frameworks.
perl often doesn't get updated because people don't have a way to know if their current code works with the new one. The problem is that they lack unit tests. This talk describes how simple it is to generate unit tests with Perl and shell, use them to automate solving problems like missing modules, and test a complete code base.
Nagios Conference 2011 - Nathan Vonnahme - Integrating Nagios With Test Drive...Nagios
Nathan Vonnahme's presentation on integrating Nagios with test driven development. The presentation was given during the Nagios World Conference North America held Sept 27-29th, 2011 in Saint Paul, MN. For more information on the conference (including photos and videos), visit: http://go.nagios.com/nwcna
I am Kefa J. I am a Database Management Homework Expert at databasehomeworkhelp.com. I hold a Ph.D. in Programming, Princeton University, USA. I have been helping students with their homework for the past 12 years. I solve homework related to Database Management.
Visit databasehomeworkhelp.com or email info@databasehomeworkhelp.com. You can also call on +1 678 648 4277 for any assistance with Database Management Homework.
Mastering PowerShell Testing with PesterMark Wragg
Presentation delivered at the PSDay.UK conference in London, October 2018 on Mastering PowerShell Testing with the testing framework Pester for unit testing your PowerShell code.
Discover more about Ansible! Ansible Tower and Ansible Containers:)
The slides which I used to give a talk about Ansible at DevOps North East. The slides have been modified to make it easier to understand in case you have missed the talk :)
North Virginia Coldfusion User Group Meetup - Testbox - July 19th 2017Ortus Solutions, Corp
Testbox is a tool we all should be using to test our ColdFusion Applications which was created and is maintained by Ortus Solutions, the people that brought you ColdBox. We will have Gavin from Ortus in house on this day to go over some testbox examples, talk about its importance, and answer any questions you have.
SO --- if you have and high level questions for Gavin, reply to this post (or hit me up) so I can get the questions to Gavin a head of time just in case he needs to consult others at Ortus.
Gavin Pickin is a proud ColdFusion developer, starting with ColdFusion in the late 90s. Now working with Ortus Solutions, a leading force in CFML Development frameworks and tools, Gavin gets to work on a lot of great projects, for a big variety of clients. At Ortus Solutions, a big focus is on free and open source tools, on open source Fridays, Gavin spend most of his open source time working on ContentBox Content Management System.
The Art of the Pitch: WordPress Relationships and SalesLaura Byrne
Clients don’t know what they don’t know. What web solutions are right for them? How does WordPress come into the picture? How do you make sure you understand scope and timeline? What do you do if sometime changes?
All these questions and more will be explored as we talk about matching clients’ needs with what your agency offers without pulling teeth or pulling your hair out. Practical tips, and strategies for successful relationship building that leads to closing the deal.
JMeter webinar - integration with InfluxDB and GrafanaRTTS
Watch this recorded webinar about real-time monitoring of application performance. See how to integrate Apache JMeter, the open-source leader in performance testing, with InfluxDB, the open-source time-series database, and Grafana, the open-source analytics and visualization application.
In this webinar, we will review the benefits of leveraging InfluxDB and Grafana when executing load tests and demonstrate how these tools are used to visualize performance metrics.
Length: 30 minutes
Session Overview
-------------------------------------------
During this webinar, we will cover the following topics while demonstrating the integrations of JMeter, InfluxDB and Grafana:
- What out-of-the-box solutions are available for real-time monitoring JMeter tests?
- What are the benefits of integrating InfluxDB and Grafana into the load testing stack?
- Which features are provided by Grafana?
- Demonstration of InfluxDB and Grafana using a practice web application
To view the webinar recording, go to:
https://www.rttsweb.com/jmeter-integration-webinar
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualityInflectra
In this insightful webinar, Inflectra explores how artificial intelligence (AI) is transforming software development and testing. Discover how AI-powered tools are revolutionizing every stage of the software development lifecycle (SDLC), from design and prototyping to testing, deployment, and monitoring.
Learn about:
• The Future of Testing: How AI is shifting testing towards verification, analysis, and higher-level skills, while reducing repetitive tasks.
• Test Automation: How AI-powered test case generation, optimization, and self-healing tests are making testing more efficient and effective.
• Visual Testing: Explore the emerging capabilities of AI in visual testing and how it's set to revolutionize UI verification.
• Inflectra's AI Solutions: See demonstrations of Inflectra's cutting-edge AI tools like the ChatGPT plugin and Azure Open AI platform, designed to streamline your testing process.
Whether you're a developer, tester, or QA professional, this webinar will give you valuable insights into how AI is shaping the future of software delivery.
Connector Corner: Automate dynamic content and events by pushing a buttonDianaGray10
Here is something new! In our next Connector Corner webinar, we will demonstrate how you can use a single workflow to:
Create a campaign using Mailchimp with merge tags/fields
Send an interactive Slack channel message (using buttons)
Have the message received by managers and peers along with a test email for review
But there’s more:
In a second workflow supporting the same use case, you’ll see:
Your campaign sent to target colleagues for approval
If the “Approve” button is clicked, a Jira/Zendesk ticket is created for the marketing design team
But—if the “Reject” button is pushed, colleagues will be alerted via Slack message
Join us to learn more about this new, human-in-the-loop capability, brought to you by Integration Service connectors.
And...
Speakers:
Akshay Agnihotri, Product Manager
Charlie Greenberg, Host
Transcript: Selling digital books in 2024: Insights from industry leaders - T...BookNet Canada
The publishing industry has been selling digital audiobooks and ebooks for over a decade and has found its groove. What’s changed? What has stayed the same? Where do we go from here? Join a group of leading sales peers from across the industry for a conversation about the lessons learned since the popularization of digital books, best practices, digital book supply chain management, and more.
Link to video recording: https://bnctechforum.ca/sessions/selling-digital-books-in-2024-insights-from-industry-leaders/
Presented by BookNet Canada on May 28, 2024, with support from the Department of Canadian Heritage.
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Tobias Schneck
As AI technology is pushing into IT I was wondering myself, as an “infrastructure container kubernetes guy”, how get this fancy AI technology get managed from an infrastructure operational view? Is it possible to apply our lovely cloud native principals as well? What benefit’s both technologies could bring to each other?
Let me take this questions and provide you a short journey through existing deployment models and use cases for AI software. On practical examples, we discuss what cloud/on-premise strategy we may need for applying it to our own infrastructure to get it to work from an enterprise perspective. I want to give an overview about infrastructure requirements and technologies, what could be beneficial or limiting your AI use cases in an enterprise environment. An interactive Demo will give you some insides, what approaches I got already working for real.
Elevating Tactical DDD Patterns Through Object CalisthenicsDorra BARTAGUIZ
After immersing yourself in the blue book and its red counterpart, attending DDD-focused conferences, and applying tactical patterns, you're left with a crucial question: How do I ensure my design is effective? Tactical patterns within Domain-Driven Design (DDD) serve as guiding principles for creating clear and manageable domain models. However, achieving success with these patterns requires additional guidance. Interestingly, we've observed that a set of constraints initially designed for training purposes remarkably aligns with effective pattern implementation, offering a more ‘mechanical’ approach. Let's explore together how Object Calisthenics can elevate the design of your tactical DDD patterns, offering concrete help for those venturing into DDD for the first time!
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Albert Hoitingh
In this session I delve into the encryption technology used in Microsoft 365 and Microsoft Purview. Including the concepts of Customer Key and Double Key Encryption.
State of ICS and IoT Cyber Threat Landscape Report 2024 previewPrayukth K V
The IoT and OT threat landscape report has been prepared by the Threat Research Team at Sectrio using data from Sectrio, cyber threat intelligence farming facilities spread across over 85 cities around the world. In addition, Sectrio also runs AI-based advanced threat and payload engagement facilities that serve as sinks to attract and engage sophisticated threat actors, and newer malware including new variants and latent threats that are at an earlier stage of development.
The latest edition of the OT/ICS and IoT security Threat Landscape Report 2024 also covers:
State of global ICS asset and network exposure
Sectoral targets and attacks as well as the cost of ransom
Global APT activity, AI usage, actor and tactic profiles, and implications
Rise in volumes of AI-powered cyberattacks
Major cyber events in 2024
Malware and malicious payload trends
Cyberattack types and targets
Vulnerability exploit attempts on CVEs
Attacks on counties – USA
Expansion of bot farms – how, where, and why
In-depth analysis of the cyber threat landscape across North America, South America, Europe, APAC, and the Middle East
Why are attacks on smart factories rising?
Cyber risk predictions
Axis of attacks – Europe
Systemic attacks in the Middle East
Download the full report from here:
https://sectrio.com/resources/ot-threat-landscape-reports/sectrio-releases-ot-ics-and-iot-security-threat-landscape-report-2024/
Key Trends Shaping the Future of Infrastructure.pdfCheryl Hung
Keynote at DIGIT West Expo, Glasgow on 29 May 2024.
Cheryl Hung, ochery.com
Sr Director, Infrastructure Ecosystem, Arm.
The key trends across hardware, cloud and open-source; exploring how these areas are likely to mature and develop over the short and long-term, and then considering how organisations can position themselves to adapt and thrive.
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...James Anderson
Effective Application Security in Software Delivery lifecycle using Deployment Firewall and DBOM
The modern software delivery process (or the CI/CD process) includes many tools, distributed teams, open-source code, and cloud platforms. Constant focus on speed to release software to market, along with the traditional slow and manual security checks has caused gaps in continuous security as an important piece in the software supply chain. Today organizations feel more susceptible to external and internal cyber threats due to the vast attack surface in their applications supply chain and the lack of end-to-end governance and risk management.
The software team must secure its software delivery process to avoid vulnerability and security breaches. This needs to be achieved with existing tool chains and without extensive rework of the delivery processes. This talk will present strategies and techniques for providing visibility into the true risk of the existing vulnerabilities, preventing the introduction of security issues in the software, resolving vulnerabilities in production environments quickly, and capturing the deployment bill of materials (DBOM).
Speakers:
Bob Boule
Robert Boule is a technology enthusiast with PASSION for technology and making things work along with a knack for helping others understand how things work. He comes with around 20 years of solution engineering experience in application security, software continuous delivery, and SaaS platforms. He is known for his dynamic presentations in CI/CD and application security integrated in software delivery lifecycle.
Gopinath Rebala
Gopinath Rebala is the CTO of OpsMx, where he has overall responsibility for the machine learning and data processing architectures for Secure Software Delivery. Gopi also has a strong connection with our customers, leading design and architecture for strategic implementations. Gopi is a frequent speaker and well-known leader in continuous delivery and integrating security into software delivery.
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf91mobiles
91mobiles recently conducted a Smart TV Buyer Insights Survey in which we asked over 3,000 respondents about the TV they own, aspects they look at on a new TV, and their TV buying preferences.
2. Scott van Kalken
Everyone just calls me “svk” (it’s easier)
I have the privilege of helping run a
few meetups.
Super passionate about open source (not
just software, but data too)
3. ANSIBLE AND TESTING?!?!?!
Ansible is an awesome toolkit / language to allow you to just get things done.
There are modules and frameworks that allow you to perform testing on roles.
Molecule is one of them.
https://molecule.readthedocs.io/en/stable/
See Rishbah’s fantastic talk on this last time :)
4. ANSIBLE AND TESTING!?!?!?!
What about if I want to do something other than unit testing?
What are my options?
Can I use Ansible?
Is it a good idea to use Ansible?
...someone recently asked me all of these questions and I didn’t have good answers, so I
decided to explore the topic (and do a talk of course).
7. THE ASSERT MODULE
- hosts: "{{ target_hosts | default('localhost') }}"
become: yes
become_user: root
vars:
my_param: 10
tasks:
- name: Check my variable
assert:
that:
- my_param <= 100
- my_param >= 0
fail_msg: "'my_param' must be between 0 and 100"
success_msg: "'my_param' is between 0 and 100"
Custom failure and success messages,
these can be set to anything that you
like.
8. THE ASSERT MODULE
TASK [Check my variable] ********************************
fatal: [localhost]: FAILED! => {
"assertion": "my_param <= 100",
"changed": false,
"evaluated_to": false,
"msg": "'my_param' must be between 0 and 100"
}
TASK [Check my variable] *******************************
ok: [localhost] => {
"changed": false,
"msg": "'my_param' is between 0 and 100"
}
9. A REAL WORLD EXAMPLE
Let’s see what a real world example looks like.
I have a database, and want to make sure that my playbook has been passed all
of the appropriate variables BEFORE I run a task to configure the database.
10. THE PLAYBOOK
- hosts: "{{ target_hosts | default('localhost') }}"
become: yes
become_user: root
tasks:
- assert:
that:
- db_host != ''
- db_port != ''
- db_user != ''
- db_user != 'root'
- db_password != ''
- db_name != ''
tags: ['check_vars']
Assertions around variables that are
set.
This can be used in a playbook at the
beginning to check that variables are
set before running something
There is a trick here though.
Can you see it?
11. THE PLAYBOOK
- hosts: "{{ target_hosts | default('localhost') }}"
become: yes
become_user: root
tasks:
- assert:
that:
- db_host != ''
- db_port != ''
- db_user != ''
- db_user != 'root'
- db_password != ''
- db_name != ''
tags: ['check_vars']
Using the inbuilt tags function of
Ansible, you can run this as a check
before running the playbook.
This is most useful if you are using a
pipeline for deployment!
# ansible-playbook -t check_vars playbook.yml --extra-vars “db_host=foo”
12. CHECK THAT A FILE EXISTS (ASSERT)
- stat:
path: /path/to/something
register: p
- assert:
that:
- p.stat.exists and p.stat.isdir
You can check that a file exists - but can use a logical AND to stack checks (you
can use logical OR also).
14. STANDARD ANSIBLE LOOPS
Don’t forget about standard ansible loops.
Standard ansible loops can be used quite effectively as part of functional
testing if you are waiting for a particular output, or you are waiting for
something to happen.
….and yes because it’s ansible there are a lot of other ways to do this.
15. STANDARD ANSIBLE LOOPS
A CONTRIVED EXAMPLE:
#!/bin/bash
CFGFILE=a.cfg
if [ -f $CFGFILE ]; then
source $CFGFILE
else
echo "COUNT=0" > $CFGFILE
source $CFGFILE
fi
COUNT=$((COUNT+1))
echo $COUNT
echo "COUNT=$COUNT" > $CFGFILE
Script does nothing but increment its
output by one every time it is run.
First run: 0
Second run: 1
Third run: 2
...and so on.
16. STANDARD ANSIBLE LOOPS
The playbook uses a standard
loop until the output from the
command is “3”.
The task will try this 10 times
with a delay of five seconds
between each run.
This is useful if you’re waiting
for something to happen.
- hosts: "{{ target_hosts | default('localhost') }}"
become: yes
become_user: root
gather_facts: false
tasks:
- name: Check output of command and stdout
shell: ./a.sh
register: result
until: result.stdout.find("3") != -1
retries: 10
delay: 5
18. STANDARD ANSIBLE LOOPS
Consider the following example:
● Build Infrastructure
● Install application server
● Wait for application to come up
● Perform functional testing
In this scenario, waiting can be used in combination with assertions to perform
comprehensive functional testing.
19. ROLLING DEPLOYMENT PATTERNS
You can put all of this together to bring a rolling deployment task with
gated testing to your deployments.
For example:
1) Drop application from load balancer
2) Install new version of application
3) Perform functional testing
4) Add application back to load balancer
Using pre tasks, assertions and post tasks, it is possible to set conditions
on failure such that a bad application deployment is automatically tested
and not added back to your live system.
21. ROLLING DEPLOYMENT PATTERNS
- hosts: webservers
pre_tasks:
- name: take out of load balancer pool
command: /usr/bin/take_out_of_pool {{ inventory_hostname }}
roles:
- common
- webserver
- apply_testing_checks
post_tasks:
- name: add back to load balancer pool
command: /usr/bin/add_back_to_pool {{ inventory_hostname }}
22. COOL - I CAN DO TESTING WITH ANSIBLE
Yes you certainly can.
Functional testing.
Microservice testing.
Expect like functionality (for those who know expect)
...and a whole lot more.
23. DON’T CONFUSE DECLARATIVE INTENT & TESTING
Don’t confuse ansible’s declarative intent with testing.
A lot of the time, we may test things in a way to pause before carrying on to
another task.
The declarative intent / enforcement of ansible takes care of the initial thing, but
we need to make sure it has finished before we move on.
Other times we will perform functional testing.
24. DECLARATIVE CONFIGURATION
If you think the service may not be started, the best thing to do is request
it to be started.
- name: Start httpd
systemd:
name: httpd
state: started
If the service fails to start, Ansible will tell you.
25. FUNCTIONAL TESTING
- name: Fetch Java version
shell: java -version 2>&1 | grep version | awk '{print $3}' | sed 's/"//g'
register: java_version
- assert:
that:
- java_version.stdout | version_compare('1.7', '>=')
The snippet above checks something functional (the version of java), but
it could equally be checking a webservice, or the previous example of
checking that AWX has started correctly.
26. SO SHOULD I USE ANSIBLE FOR TESTING?
If you want to have a single language for all of your testing needs.
If you want to test the applications that you’ve deployed - then Ansible is
a good fit.
What @svk has seen:
● There is a (large) company in Melbourne who is currently assessing
running their post application testing using ansible.
● You can embed tests into a pipeline.
● You can make the world a better place by using ansible (of course!)