Skip to content

davecore82/ansible-multiple-sites-devopsmtl-20140505

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

  1. add montreal and quebec to hosts file

[montreal]
ansiblemaster
ansible1

[quebec]
ansible2
  1. create group_vars folder with montreal and quebec

group_vars/montreal

ntp_server1: 2.pool.ntp.org
ntp_server2: 3.pool.ntp.org
dns_server: 8.8.8.8


group_vars/quebec

ntp_server1: 0.pool.ntp.org
ntp_server2: 1.pool.ntp.org
dns_server: 8.8.4.4
  1. take hardcoded files from files and put them in templates

templates/ntp.conf.j2

driftfile /var/lib/ntp/ntp.drift

server {{ ntp_server1 }}
server {{ ntp_server2 }}


templates/resolv.conf.j2

; generated by /sbin/dhclient-script
search us-west-2.compute.internal
nameserver {{ dns_server }}
  1. change copy modules for template in common role

- name: Configuration fichier ntp.conf - TEMPLATE
  template: backup=yes src=ntp.conf.j2 dest=/etc/ntp.conf owner=root group=root mode=0644
  notify: Restart ntpd

- name: Configuration fichier resolv.conf - TEMPLATE
  template: backup=yes src=resolv.conf.j2 dest=/etc/resolv.conf owner=root group=root mode=0644
  1. run ansible with new template changes

ansible-playbook --private-key=/home/dave/ec2.pem -u ec2-user site.yml -s

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published