...
Each of those repositories will have specific instructions on how to use them, but here are the fundamental steps to get started if you want to use them directly on the command line or CI/CD pipeline:
...
Install ansible and other dependencies. You may want to do it in its own virtual environment (pip install -r requirements.txt
)
...
Multiexcerpt |
---|
MultiExcerptName | ewc-generic-playbook-usage |
---|
|
You may run Ansible on the same instance or anywhere else from where you can connect to your instance via SSH, such as another instance in the same private network, or from your own computer if your instance can be reached over SSH. We will refer to this as your seed platform. You will need at least git and python available to follow these steps. - On your seed platform, clone the repository and cd into the directory:
No Format |
---|
git clone <repository-url>
cd <repository> |
- If you don't have Ansible installed, you may install it with pip:
No Format |
---|
pip install --user -r requirements.txt | or if you prefer to do it in a virtual environment:
No Format |
---|
python3 -m venv ansible-venv
source ansible-venv/bin/activate
pip install -r requirements.txt |
- Install the necessary Ansible roles that are going to be used by the playbooks:
|
ansible-galaxy role install -r requirements.yml roles/ |
- If you don't have it already, define your Ansible inventory. The simplest approach would be to create a file called
inventory , on the same directory where the plabooks are, containing the fully qualified domain name (FQDN) or IP address used to connect to the instance from your seed platform. If running
|
...
- on the same instance, you may use localhost.
|
...
- Apply the desired playbook with
ansible-playbook:
|
...
ansible-playbook -i inventory playbookname.yml | You may pass additional options to ansible-playbook , such as:-v for verbose output-K for asking sudo password, if your user does not have password-less sudo privileges on the target instance.-u yourremoteuser if Ansible needs to use a specific user account to connect to the target instance.-e var=value for add-hoc customisation of playbook variables to customise your installation.
Tip |
---|
title | Further customisation |
---|
| Check each specific role documentation in the URLs found in requirements.yml to see all the variables you may customise when running the automation. For example, for the Anemoi role: https://github.com/ewcloud/ewc-ansible-role-anemoi |
|
Ansible role repositories
...