• Home
  • Ansible
  • About
  • Index
My Daily Tutorials

Tutorials

  • Ansible

How to Create a Directory in Ansible

Posted on October 4, 2017April 27, 2018by Ansible admin

You will need to create directories or folders in Ansible many times during may of the DevOps process. Although you could do create directories using shell or command module, ansible provides a better and safer method for creating directories using the ‘file’ module. Ansible Directory Creation example To create a directory using the file module, […]

Read More
  • Ansible

Working with Ansible User Module

Posted on October 3, 2017April 27, 2018by Ansible admin

Ansible user module helps us to manage user accounts in Linux systems including creating user accounts, deleting them, setting passwords, adding groups to each user, etc. How to create users in Ansible Let us first see how to write a basic task for creating a Linux user using the Ansible user module. There is only […]

Read More
  • Ansible

Working with Ansible Register Variables

Posted on September 30, 2017April 27, 2018by Ansible admin

Ansible registers are used when you want to capture the output of a task to a variable. You can then use the value of these registers for different scenarios like a conditional statement, logging etc. The variables will contain the value returned by the task. The common return values are documented in Ansible docs. Some […]

Read More
  • Ansible

The Basics of Ansible Variables

Posted on September 30, 2017April 27, 2018by Ansible admin

Variables are used to store values in programs and as the name suggests the values can be changed throughout the program. These values are essential to deciding the code flow. Ansible variables help to determine how the tasks execute on different systems based on the values assigned to these variables. Ansible variable names should be letters, […]

Read More
  • Ansible
  • ...
    • Tutorials

Using grep commands in Ansible tasks

Posted on September 29, 2017April 27, 2018by Ansible admin

Grep command is used on Linux/Unix to search for a particular pattern in a list of files. There is no Ansible grep module, but you can use the grep commands along with shell module or command module. We can store the results of the task and use it in various conditional statements, print them or use […]

Read More
  • Ansible

Working with Ansible filters

Posted on August 27, 2017April 27, 2018by Ansible admin

You can use Ansible filters when you need to format data inside template expressions. You are provided with a set of filters that are shipped with Ansible and another set provided by Jinja2 template engine. You can also build your own filters. In the following sections, I will give a list of useful filters and […]

Read More
  • Ansible

User inputs with Ansible Prompt with examples

Posted on August 27, 2017April 27, 2018by Ansible admin

Working with Ansible Prompts. Sometimes you need input from the user to decide how the playbook should run. Maybe you need to name a directory. Maybe there are plays written for installing multiple versions. And you can install one version based on the user input. Or there may be some data which is sensitive you […]

Read More
  • Ansible

How to zip files and folders with Ansible

Posted on August 3, 2017April 27, 2018by Ansible admin

Working with Ansible archive module Until version 2.3, Ansible didn’t support an Archive module(It was available in the developer edition for some time though). Before that, we had to use the shell module or command module to zip a directory in Ansible. From 2.3 you can use the Ansible archive module to compress the files […]

Read More
  • Ansible

Working with Ansible variables in conditionals

Posted on July 29, 2017April 27, 2018by Ansible admin

Variables are necessary when you need to store the output of a task and need to access it in some other tasks. They are mostly used when dealing with a conditional statement where you can opt to run the task based on the output of another task. Here I will show some examples of using […]

Read More
  • Ansible

Using the Ansible find module to search for files/folder

Posted on July 29, 2017April 27, 2018by Ansible admin

Ansible find module is used when you need to retrieve a list of files in the remote server which matches some conditions like name, size, etc. You will have to provide the path(s) to the remote server where the search should be done. It also supports searching for directories and links. The module returns the list of […]

Read More

Posts navigation

Older posts
Newer posts

Mydailytutorials.com is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to Amazon.com.

Recent Posts

  • How to create files in Ansible
  • Replacing Strings and Lines in Ansible
  • Working with Ansible yum module
  • Ansible Pip Module – Managing Python Packages
  • Working with Environment​ Variables in Ansible

Categories

  • Ansible
  • Linux
  • Tutorials
Mydailytutorials.com is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to Amazon.com. Theme by Colorlib Powered by WordPress