christiangda.awscli

Ansible Rolle: christiangda.awscli

Master Branch Workflow Develop Branch Workflow Ansible Rolle

Diese Rolle installiert das AWS Command Line Interface (awscli).

Die beste Möglichkeit, diese Rolle zu installieren, ist der Befehl ansible-galaxy install christiangda.awscli. Das Ansible Galaxy Repository ist christiangda.awscli.

Der Repository-Code ist https://github.com/christiangda/ansible-role-awscli.

Hinweise:

Anforderungen

Diese Rolle funktioniert auf den Distributionen RedHat, CentOS, Debian und Ubuntu.

  • RedHat
    • 7
    • 8
  • CentOS
    • 7
    • 8
  • Ubuntu
    • 16.*
    • 18.*
    • 20.*
    • 21.*
  • Debian
    • stretch (9)
    • buster (10)
    • bullseye (11)

Um die Kompatibilität von Python versus Ansible zu sehen, schauen Sie sich die Travis-CI-Baumatrix an.

Rollenvariablen

Keine

Abhängigkeiten

Hinweis: RedHat/CentOS 8 benötigt kein EPEL-Repository, um diese Rolle zu verwenden.

Beispiel-Playbook

RedHat/CentOS, Ubuntu und Debian

Wenn Sie RedHat/CentOS 8 oder Debian/Ubuntu haben:

- hosts: redhat-8
    gather_facts: True
    roles:
      - role: christiangda.awscli

Wenn Sie ein Ziel mit RedHat/CentOS 6/7 haben:

- hosts: redhat-7
    gather_facts: True
    roles:
      - role: christiangda.epel_repo
      - role: christiangda.awscli

Wenn Sie mehrere Betriebssysteme haben und das EPEL-Repository nur für RedHat/CentOS 6/7 installieren möchten:

- hosts: servers
    gather_facts: True
    roles:
    - role: christiangda.epel_repo
      when: >
        ansible_os_family == 'RedHat' and (
          ansible_distribution == 'CentOS' or
          ansible_distribution == 'RedHat'
        )
        and (
          ansible_distribution_major_version == '6' or
          ansible_distribution_major_version == '7'
        )
      changed_when: false
    - role: christiangda.awscli

Wenn Sie RedHat/CentOS 8 oder Debian/Ubuntu haben und die Rolle christiangda.awscli verwenden möchten:

- hosts: redhat-8
    gather_facts: True
    roles:
      - role: christiangda.awscli
      - role: christiangda.awscli_configure
        vars:
          awscliconf_files:
            credentials:
              - default:
                  aws_access_key_id: 'AKIAIOSFODNN7EXAMPLE'
                  aws_secret_access_key: 'wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY'
            config:
              - default:
                  region: us-west-2
                  output: json
              - profile development:
                  role_arn: 'arn:aws:iam::123456789012:role/role-for-development'
                  mfa_serial: 'arn:aws:iam::11111111111:mfa/christian.gonzalez'
                  region: eu-west-1
                  source_profile: default

Entwicklung / Mitwirken

Diese Rolle wird mit Molecule getestet und wurde mit Python Virtual Environments entwickelt.

Wir verwenden auch die Haupt-Git-Branches

  • master
  • develop

Wenn Sie zu diesem Projekt beitragen möchten, machen Sie Folgendes:

Referenzen

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
pip install 'molecule[docker]'
pip install 'molecule[lint]'
pip install molecule-vagrant
pip install python-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
pip install ansible-lint
git clone https://github.com/christiangda/ansible-role-awscli.git
ln -s ansible-role-awscli christiangda.awscli
cd christiangda.awscli

Führen Sie den Molecule-Test aus

Verfügbare Szenarien:

  • default --> --driver-name docker und nur die neueste Version des Betriebssystems
  • docker --> --driver-name docker
  • podman --> --driver-name podman
  • vagrant --> --driver-name vagrant

Szenario default

Schritt für Schritt

molecule create [--scenario-name default]
molecule converge [--scenario-name default]
molecule verify [--scenario-name default]
molecule destroy [--scenario-name default]

oder

Alles in einem

molecule test [--scenario-name default]

Szenario podman

Schritt für Schritt

molecule create --scenario-name podman
molecule converge --scenario-name podman
molecule verify --scenario-name podman
molecule destroy --scenario-name podman

oder

Alles in einem

molecule test --scenario-name podman

Szenario vagrant

Schritt für Schritt

molecule create --scenario-name vagrant
molecule converge --scenario-name vagrant
molecule verify --scenario-name vagrant
molecule destroy --scenario-name vagrant

oder

Alles in einem

molecule test --scenario-name vagrant

Zusätzlich, wenn Sie es mit VMs testen möchten, habe ich ein sehr schönes ansible-playground-Projekt, das Vagrant und VirtualBox verwendet. Probieren Sie es aus!

Lizenz

Dieses Modul wird unter der GNU General Public License Version 3 veröffentlicht:

Autor Informationen

Installieren
ansible-galaxy install christiangda.awscli
Lizenz
gpl-3.0
Downloads
53.8k