94 private links
You certainly remember the first time you ran an Ansible playbook: a few lines of code grouped together in a bunch of tasks that did a lot of magic. Struck by curiosity, you surely asked yourself…
Ever wanted to make your command or shell call in Ansible playbook idempotent and avoid those nasty yellow changed lines in run logs? Wait no more! Here's bash trick for you: - name: Put docker package on hold shell: > apt-mark showholds | grep -q docker-ce && echo -n HOLDED || apt-mark hold docker-ce register: docker_hold changed_when: docker_hold.stdout != 'HOLDED' What do we do here? 1. We execute "check" command apt-mark showholds | grep -q docker-c
AlmaLinux OS Documentation
Many servers use one or more virtual machines (VMs), e.g. to isolate a public service in the best possible way and to protect the host server from compromise. This article explores the possibilities of deploying Fedora Cloud Base images as a VM in an autonomous Fedora 33 Server Edition using version 3 of virt-install. This […]
In this post, we’re going to see how we can create virtual machines in seconds, the way it’s done in modern cloud infrastructures such as EC2 and Digital Ocean. This is kind of a continuation of my previous post, where I explain the basics of virtualization and create a virtual machine in the old-school way. So let’s dive right into it!
Using Ansible makes provisioning virtual machines automated, flexible, repeatable, and fast.
It's handy to have a lab environment separate from your day-to-day workstation. Use these commands to set up a place to learn and experiment without risking your work environment.
Ansible role to install and configure neovim
Recommended practices for all elements of automation using Ansible, starting with collections and roles, continuing with playbooks, inventories and plug-ins... These good practices are planned to be used by all Red Hat teams interested but can of course be used by others. - automation-good-practices/README.adoc at main · redhat-cop/automation-good-practices
ansible-language-server extension for coc.nvim. Contribute to yaegassy/coc-ansible development by creating an account on GitHub.
Using SSH agent forwarding is dangerous. However, a dedicated agent can mitigate the risks.
Important for HCL Connections Automation! The global UseAgentForward needs more documentation and anrework to avoid.
Ansible is one of the most prominent tools among DevOps for managing software configuration because of its ease of use and bare minimum dependencies. The highlight of this tool is Ansible roles which provide a wholesome package of various functionalities that we need for software configuration.
As we know that ansible roles have a wide directory structure that looks something like this.
$ tree -d . ├── defaults ├── files ├── handlers ├── media ├── meta ├── molecule │ └── default │ └── tests ├── tasks └── templates 10 directories
We can read online about the significance of these directories but often there is some confusion around two of them that always bugs me, which are vars and defaults. Whenever I write a role I often think of whether to put my variables in defaults or the vars.
According to Ansible’s definition, the difference between defaults and vars is:
defaults mean “default variables for the roles” and vars mean “other variables for the role”.
The priority of the vars is higher than that of defaults.
For example, consider a variable named ‘version’ defined in the defaults have value ‘5.0.1’ and the same variable defined in vars have value ‘7.1.3’, so the final value that will be taken into account is the value defined in vars i.e., ‘7.1.3’.
Due to my limited understanding of this, I used to define all variables in defaults and whenever needed to override them, I declared those variables in vars.
But there was more to it just than precedence, which motivated me to deep dive into it and finds out that there are two types of variables in terms of content, “static” with constant value and “dynamic” with changing value. According to the ansible definition, the static variables should be placed in default and the dynamic should be placed in vars.