Skip to Content
Security Automation with Ansible 2
book

Security Automation with Ansible 2

by Akash Mahajan, MADHU AKULA
December 2017
Intermediate to advanced
364 pages
7h 30m
English
Packt Publishing
Content preview from Security Automation with Ansible 2

Playbook to do this with automation

To perform the preceding trigger, we can use the following Ansible playbook. This can be used in our Ansible Tower to schedule the scan as well.

The following playbook can store the the API Token key using Ansible Vault, feature to store secret data in an encrypted format in playbooks. We will learn more about Ansible Vault usage in Chapter 11, Ansible Security Best Practices, References and Further Reading.

To create an Ansible Vault encrypted variable, run the following command. When it prompts for a password, give a password to encrypt this variable and it requires while executing the playbook

echo 'YOURTOKENGOESHERE' | ansible-vault encrypt_string --stdin-name 'jenkins_api_token'

After executing, it ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Implementing DevOps with Ansible 2

Implementing DevOps with Ansible 2

Jonathan McAllister
Practical Ansible 2

Practical Ansible 2

Daniel Oh, James Freeman, Fabio Alessandro Locati

Publisher Resources

ISBN: 9781788394512Supplemental Content