christiangda.amazon_ssm_agent
Ansible Rolle: christiangda.amazon_ssm_agent
Diese Rolle installiert den AWS Systems Manager Agent.
Funktionen:
- Lädt den AWS Systems Manager Agent aus dem AWS-Verteilungspaket herunter und installiert ihn.
- Dreht die Protokolldatei des Agents.
Anforderungen
Diese Rolle funktioniert auf RedHat, CentOS, Amazon Linux, Debian und Ubuntu Distributionen.
- RedHat
- 6
- 7
- 8
- CentOS
- 6
- 7
- 8
- Amazon Linux
- 1
- 2
- Ubuntu
- 16.*
- 18.*
- Debian
- jessie
- sid
- stretch
Um die Kompatibilität von Python und Ansible zu sehen, siehe das Projekt Travis-CI-Baummatrix.
Rollen-Variablen
# mögliche Werte:
# - true
# - false
# Standardwert: false
# Anmerkungen:
# * den Wert auf true setzen, wenn die installierte Version aktualisiert werden soll
ssm_update: false
Abhängigkeiten
Keine
Beispiel-Playbook
RedHat/CentOS, Ubuntu und Debian
- hosts: servers
gather_facts: True
roles:
- role: christiangda.amazon_ssm_agent
vars:
ssm_update: true
Amazon Linux 1/2 (my-playbook.yml)
- hosts: all
gather_facts: True
become: true
become_user: root
become_method: sudo
remote_user: ec2-user
roles:
- role: christiangda.amazon_ssm_agent
Beispiel für eine Inventardatei (inventory)
[all]
10.14.x.y
10.14.v.z
[amazon-1]
10.14.x.y
[amazon-2]
10.14.v.z
So benutzen Sie es
ansible-playbook my-playbook.yml \
--inventory inventory \
--private-key [~/standort meiner key.pem] \
--become \
--become-user=ec2-user \
--user ec2-user
Entwicklung / Mitwirken
Diese Rolle wird mit Molecule getestet und wurde unter Verwendung von Python Virtual Environments entwickelt.
Bereiten Sie Ihre Umgebung vor
Python 3
mkdir ansible-roles
cd ansible-roles/
python3 -m venv venv
source venv/bin/activate
pip install pip --upgrade
pip install ansible
pip install molecule">=2.22rc1"
pip install molecule[vagrant]
pip install selinux
pip install docker
pip install pytest
pip install pytest-mock
pip install pylint
pip install rope
pip install autopep8
pip install yamllint
pip install flake8
Python 2.7
Abhängigkeiten
sudo dnf install redhat-rpm-config
sudo dnf install python-devel
sudo dnf install libselinux-python
mkdir ansible-roles
cd ansible-roles/
python2.7 -m virtualenv venv
source venv/bin/activate
pip install pip --upgrade
pip install ansible
pip install molecule">=2.22rc1"
pip install molecule[vagrant]
pip install selinux
pip install docker
pip install pytest
pip install pytest-mock
pip install pylint
pip install rope
pip install autopep8
pip install yamllint
pip install flake8
Klone das Rollen-Repository und erstelle einen symbolischen Link
git clone https://github.com/christiangda/ansible-role-amazon-ssm-agent.git
ln -s ansible-role-amazon-ssm-agent christiangda.amazon_ssm_agent
cd christiangda.amazon_ssm_agent
Führen Sie den Test aus
Verwendung von Docker lokal
molecule test [--scenario-name default]
Verwendung von Vagrant lokal
molecule create --scenario-name vagrant
molecule converge --scenario-name vagrant
molecule verify --scenario-name vagrant
oder
molecule test --scenario-name vagrant
Zusätzlich, wenn Sie Tests mit VMs durchführen möchten, habe ich ein sehr schönes ansible-playground Projekt, das Vagrant und VirtualBox verwendet, probieren Sie es aus!
Lizenz
Diese Moduldokumentation wird unter der GNU General Public License Version 3 veröffentlicht:
Autoreninformation
Ansible Role for AWS Systems Manager Agent (SSM Agent)
ansible-galaxy install christiangda.amazon_ssm_agent