Guest User

Untitled

a guest
Jan 13th, 2018
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.87 KB | None | 0 0
  1. ## Edit file common.yaml
  2.  
  3. iac_workshop/puppetlabs/code/environments/production/data/common.yaml needs two new lines.
  4. ```
  5. dnsserver : ‘8.8.4.4’
  6. searchdomain : ‘amazonaws.com’
  7. ```
  8.  
  9. ## Create new Puppet Manifest
  10.  
  11. iac_workshop/puppetlabs/code/environments/production/modules/profile/manifests/dns.pp`
  12.  
  13. ```
  14. class dns {
  15. $dnsserver = hiera('dnsserver')
  16. $searchdomain = hiera('searchdomain')
  17.  
  18. file { '/etc/resolv.conf':
  19. content => "search ${searchdomain}\n nameserver ${dnsserver}\n",
  20. }
  21. }
  22. ```
  23.  
  24. ## Don't Forget to Update the Role
  25.  
  26. Finally, we need to update the file iac_workshop/puppetlabs/code/environments/production/modules/role/manifest/iac_node.pp
  27.  
  28. Add this line to the end:
  29.  
  30. ```
  31. include profile::dns
  32. ```
  33.  
  34. ## Check the Formatting
  35.  
  36. ```
  37. puppet parser validate iac_node.pp
  38. puppet parser validate dns.pp
  39. puppet-lint -f iac-node.pp
  40. puppet-lint -f dns.pp
  41. ```
  42.  
  43. ## Apply Puppet
Add Comment
Please, Sign In to add comment