August 2019
Beginner
608 pages
16h 7m
English
We create another Ansible host called SIDEKIQ001, which is coupled to SIDEKIQ_A in AWS. The extra attribute we give is the group, which we call middleware. This attribute is used in Ansible scripts to determine which hosts should be processed in a playbook. A custom attribute we create is role. In a clustered situation, we always designate the server to be either a slave or a master:
resource "ansible_host" "SIDEKIQ001" { inventory_hostname = "${aws_instance.SIDEKIQ_A.private_dns}" groups = ["middleware"] vars { ansible_user = "ubuntu" role = "slave" ansible_ssh_private_key_file="/tmp/mykey.pem" ansible_python_interpreter="/usr/bin/python3" ansible_ssh_common_args= " -o ProxyCommand=\"ssh -o StrictHostKeyChecking=no -i /tmp/mykey.pem ...Read now
Unlock full access