../_images/preview.png

Ansible Integration

Definition and Scope

SCOPE_SCALR SCOPE_ACC SCOPE_ROLE SCOPE_F_ROLE

Scalr provides built-in integration with Ansible Tower allowing you to add servers built by Scalr to Ansible inventories for configuration management.

Find out more about Ansible Tower here: Ansible Tower Documentation NEWWIN

Adding an Ansible Tower Server

Ansible Tower servers can be added at the Account or Scalr scope. To add an Ansible server click on the Scalr icon on the top left MENU_ACC, go down to Ansible Tower and then click on Servers. In the Servers page, click on New Server and you will be prompted for the following:

../_images/new_at_servers.png

Adding an Ansible Tower Group

Ansible Tower Groups can also be added at the Account or Scalr scope. To add an Ansible server click on the Scalr icon on the top left MENU_ACC, go down to Ansible Tower and then click on Groups. In the Groups page, click on New Group and you will be prompted for the following:

../_images/new_at_group.png

The fields above with the {x} support Global Variable Interpolation, by putting a Global Variable in the field you can pull in that value rather than specifying it in the text box.

Click here NEWWIN to find out more about Ansible Groups.

Adding an Ansible Tower Bootstrap Configuration

An Ansible Tower Bootstrap Configuration is a template that will tell servers being provisioned by Scalr what Ansible Tower server to connect to and how to join an Organization, Inventory, and Group. All of this information will be pulled into Scalr from the Ansible Tower Server once you select the AT Server field below:

../_images/new_at_bootstrap.png

Machine credentials can either be prepopulated in the Ansible Tower Server or generated when selecting the Link Machine Credentials option:

../_images/new_at_creds.png

Attaching Bootstrap Configurations to a Server

SCOPE_ROLE SCOPE_F_ROLE

Bootstrap Configurations can be added in two places:

  • The Role scope which would force the configuration on all servers built using that Role.
  • The Farm Role scope which would force the configuration on all servers built using that Farm Role.

Role Scope

If an Ansible tower server is configured at the or above the scope for the Role, the Ansible Tower tab will be available on the Role configuration screen. This option allows you to enable Ansible Tower Bootstrap for the Role and define bootstrap configuration to be used.

../_images/role_ansible.png

At a minimum, this will ensure the server is added to the correct Organization, Inventory and Group. If you want to run a Job Template during the provisioning of the server, click on the Orchestration tab, then New Rule, select the Event, and then click on AT Job:

../_images/role_ansible_job.png

Warning

Please note! You must click “Prompt on Launch” on all fields in the Ansible Tower Template for Scalr to import the Job Template.

Farm Role Scope

The Bootstrap config can also be added directly into a Farm Role. To do this, go into the Farm Role and click on Bootstrap with AT:

../_images/at_bootstrap_farmrole.png

At a minimum, this will ensure the server is added to the correct Organization, Inventory and Group. If you want to run a Job Template during the provisioning of the server, click on Orchestration within the Farm Role, New Rule, select the Event, and then click on AT Job:

../_images/at_job_farmrole.png

Warning

Please note! You must click “Prompt on Launch” on all fields in the Ansible Tower Template for Scalr to import the Job Template.