Variables

We are going to be overriding a few of the default variables. To do this, update the group_vars/common.yml file to read like this, making sure you update the do_token value to reflect your own:

do_token: !vault |
$ANSIBLE_VAULT;1.1;AES256
63376236316336633631353131313363666463363834524609643522613230653265373236353664
36653763373961313433373138633933663939452257345733336238353862383432373831393839
32316262653963333836613332366639333039393066343739303066663262323337613937623533
3461626330663363330a303538393836613835313166383030636134623530323932303266373134
35616339376138636530346632345734563457326532376233323930383535303563323634336162
31386635646636363334393664383633346636616664386539393162333062343964326561343861
33613265616632656465643664376536653334653532336335306230363834523454245337626631
33323730636562616631

droplet:
name: "WordPress"
region: "lon1"
size: "s-1vcpu-2gb"
image: "centos-7-x64"
timeout: "500"

wordpress:
domain: "http://{{ hostvars['localhost'].droplet_ip }}/"
title: "WordPress installed by Ansible on {{ os_family }} host in DigitalOcean"
username: "ansible"
password: "AnsiblePasswordForDigitalOcean"
email: "[email protected]"
theme: "sydney"
plugins:
- "jetpack"
- "wp-super-cache"
- "wordpress-seo"
- "wordfence"
- "nginx-helper"

As you can see, the majority of the values are their default values; the four values we are changing are:

  • droplet.name: This is a simple update to the name so we can easily spot our instance in the DigitalOcean control panel.
  • wordpress.domain: This is the important change here. As you can see, we are using the droplet_ip variable we set on our Ansible controller. To make the variable available to our WordPress host, we are telling Ansible to use the variable from localhost. If we hadn't done this, then the variable would not have been set; we will look at why in the next section.
  • wordpress.title: A slight tweak to the title our WordPress site is configured to reflect where it is hosted.
  • wordpress.password: Changing the password so it is more complex, as we are launching on a publicly available IP address.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.222.117.109