Vue normale

Il y a de nouveaux articles disponibles, cliquez pour rafraîchir la page.
À partir d’avant-hier4sysops

Dynamic and static Ansible inventory examples

20 décembre 2023 à 10:40

The Ansible inventory is an essential element that defines the hosts and groups of hosts where Ansible operations are executed. There are two types of inventories: static and dynamic. In this post, I will provide examples to explain how you can work with both types of inventories.

The post Dynamic and static Ansible inventory examples first appeared on 4sysops.

Ansible service module examples

28 décembre 2023 à 09:30

Ansible's service module is used to manage services on remote systems. The service module is handy for tasks related to starting, stopping, restarting, and checking the status of services. It provides a consistent and declarative way to manage services across different operating systems. In this tutorial, we will explore how to use the Ansible service module with detailed examples to showcase its capabilities.

The post Ansible service module examples first appeared on 4sysops.

A simple Ansible roles example

26 février 2024 à 14:08
If you want to deploy a web server like Apache or Nginx with Ansible, you can create a playbook outlining the installation and configuration steps. This approach works well for a single web server but can become repetitive and time-consuming if you need to deploy many servers. To streamline the process, you can use Ansible roles to avoid duplicating tasks and make deployment more efficient. To introduce the concept, this post provides a simple example of using Ansible roles.

Ansible conditionals and loops

11 mars 2024 à 10:24
An Ansible loop allows you to repeat a task or a set of tasks multiple times with different values, reducing code duplication and making playbooks more concise and maintainable. Instead of writing the same task multiple times with slight variations, you can use loops to iterate over a list of items and perform the task(s) accordingly. A conditional controls the flow of tasks based on specific conditions or criteria within playbooks. Sometimes, you must install software only on specific operating systems or if certain dependencies are met. Conditionals allow you to control the execution of tasks based on these conditions, ensuring your playbooks adapt to different environments and avoid unnecessary actions. In this tutorial, I will provide simple examples of using loops and conditionals in Ansible.

Gather system information with Ansible Facts

22 mars 2024 à 13:37
Ansible Facts are essential system information gathered from remote hosts during playbook execution. This information is crucial for making informed decisions before executing any actions. In this tutorial, I will demonstrate how to use Ansible Facts to retrieve system information and make deployment decisions using the when conditional statement.

OpenTofu example (Terraform fork): Create an EC2 instance in AWS

15 avril 2024 à 10:30
HashiCorp changed Terraform's license from open source to Business-Source License (BSL). Soon after, the open-source fork OpenTofu became available. OpenTofu is an infrastructure-as-code (IaC) tool that allows you to define and manage your infrastructure in configuration files. In this post, I demonstrate with a practical example how to create an EC2 instance in AWS with OpenTofu.
❌
❌