- To install:
pipx install ansible --include-deps
- If no
--include-deps
, the actualansible
command, part ofansible-core
(a dependency of theansible
metapackage), is not included bypipx
- If no
- Some definitions
- A host is a remote machine managed by Ansible
- An inventory is a file that describes a list of managed nodes or hosts that are logically organized in groups
- A module is a unit of work that Ansible ships to a host
- Usually written in Python (although more languages are supported)
- They return a JSON and they are removed from the host after execution
- For example
ansible.builtin.setup
is called automatically by playbooks during the implicit "Gather Facts" task
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import matplotlib | |
matplotlib.use('webagg') | |
import numpy as np | |
from scipy.special import binom | |
import matplotlib.pyplot as plt | |
from matplotlib.lines import Line2D |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# Create a basic certificate using Certbot (for Let's Encrypt) and Ansible: | |
# https://github.com/geerlingguy/ansible-role-certbot | |
from http.server import HTTPServer, SimpleHTTPRequestHandler | |
import ssl | |
domain = "example.com" # Edit with your domain | |
httpd = HTTPServer(("0.0.0.0", 443), SimpleHTTPRequestHandler) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# coding: utf-8 | |
"""Juego de la vida de Conway. | |
Autor: Juan Luis Cano <juanlu001@gmail.com> | |
El tablero es un array de NumPy, donde 0 significa célula muerta y 1 célula | |
viva. Se muestra una animación con matplotlib. | |
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# coding: utf-8 | |
# Símbolo de Levi-Civita en Python utilizando listas por comprensión | |
# Fórmula extraída de http://en.wikipedia.org/wiki/Levi-Civita_symbol#Three_dimensions | |
# Válido para Python 2 y 3 | |
# | |
# Juan Luis Cano Rodríguez <juanlu001@gmail.com> | |
from __future__ import print_function | |
import numpy as np |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import asyncio | |
import os | |
import httpx | |
async def get_all(url, headers): | |
result = {} | |
next_url = url |
NewerOlder