Browse Source

Move manifests to use directory instead of deprecated import statements

tags/4.0^2
Chris Wiegman 3 years ago
parent
commit
b63b5cd0c7
No known key found for this signature in database GPG Key ID: 622611BF2DAB7CF3
15 changed files with 31 additions and 47 deletions
  1. +9
    -12
      Vagrantfile
  2. +0
    -0
      provision/hiera.yaml
  3. +18
    -0
      provision/init/01_helpers.pp
  4. +4
    -0
      provision/init/02_init.pp
  5. +0
    -0
      provision/init/03_system.pp
  6. +0
    -0
      provision/init/04_repos.pp
  7. +0
    -0
      provision/init/05_apache.pp
  8. +0
    -0
      provision/init/06_php.pp
  9. +0
    -0
      provision/init/07_mysql.pp
  10. +0
    -0
      provision/init/08_www.pp
  11. +0
    -0
      provision/init/09_wordpress.pp
  12. +0
    -17
      provision/manifests/helpers/line.pp
  13. +0
    -14
      provision/manifests/init.pp
  14. +0
    -4
      user-data/vhosts/01_init.pp
  15. +0
    -0
      user-data/vhosts/hold.pp

+ 9
- 12
Vagrantfile View File

@@ -76,7 +76,6 @@ Vagrant.configure("2") do |config|
# set auto_update to false, if you do NOT want to check the correct
# additions version when booting this machine
config.vbguest.auto_update = true

end

# Don't check for updates with every vagrant up
@@ -115,24 +114,22 @@ Vagrant.configure("2") do |config|

# Run the system setup on the first vagrant up.
config.vm.provision "puppet" do |puppet|
puppet.manifests_path = "provision/manifests"
puppet.manifest_file = "init.pp"
puppet.manifests_path = "provision"
puppet.manifest_file = "init"
puppet.module_path = "provision/modules"
puppet.facter = { "fqdn" => "pv" }
puppet.hiera_config_path = "provision/manifests/hiera.yaml"
puppet.hiera_config_path = "provision/hiera.yaml"
end

# Run provisioning required every time we startup the box.
config.vm.provision "puppet", run: "always" do |puppet|
puppet.manifests_path = "provision/manifests"
puppet.manifest_file = "repeat.pp"
puppet.module_path = "provision/modules"
puppet.facter = { "fqdn" => "pv" }
puppet.hiera_config_path = "provision/manifests/hiera.yaml"
config.vm.provision "puppet", run: "always" do |puppet|
puppet.manifests_path = "user-data/"
puppet.manifest_file = "vhosts"
puppet.module_path = "provision/modules"
puppet.facter = { "fqdn" => "pv" }
puppet.hiera_config_path = "provision/hiera.yaml"
end



# Vagrant Triggers
#
# If the vagrant-triggers plugin is installed, we can run various scripts on Vagrant


provision/manifests/hiera.yaml → provision/hiera.yaml View File


provision/manifests/helpers/gitplugin.pp → provision/init/01_helpers.pp View File

@@ -17,3 +17,21 @@ define gitplugin ( $git_urls ) {
require => Vcsrepo["/var/www/vip.wordpress.pv/wp-content/plugins/${title}"],
}
}

# line
# Taken from Automattic's VIP Quickstart (https://github.com/Automattic/vip-quickstart)
define line($file, $line, $ensure = 'present') {
case $ensure {
default : { err ( "unknown ensure value ${ensure}" ) }
present: {
exec { "/bin/echo '${line}' >> '${file}'":
unless => "/bin/grep -qFx '${line}' '${file}'"
}
}
absent: {
exec { "/usr/bin/perl -ni -e 'print unless /^\\Q${line}\\E\$/' '${file}'":
onlyif => "/bin/grep -qFx '${line}' '${file}'"
}
}
}
}

+ 4
- 0
provision/init/02_init.pp View File

@@ -0,0 +1,4 @@
group { 'puppet': ensure => present }

Exec { path => [ '/bin/', '/sbin/', '/usr/bin/', '/usr/sbin/', '/vagrant/provision/bin/' ] }
File { owner => 0, group => 0, mode => 0644 }

provision/manifests/components/system.pp → provision/init/03_system.pp View File


provision/manifests/components/repos.pp → provision/init/04_repos.pp View File


provision/manifests/components/apache.pp → provision/init/05_apache.pp View File


provision/manifests/components/php.pp → provision/init/06_php.pp View File


provision/manifests/components/mysql.pp → provision/init/07_mysql.pp View File


provision/manifests/components/www.pp → provision/init/08_www.pp View File


provision/manifests/components/wordpress.pp → provision/init/09_wordpress.pp View File


+ 0
- 17
provision/manifests/helpers/line.pp View File

@@ -1,17 +0,0 @@
# line
# Taken from Automattic's VIP Quickstart (https://github.com/Automattic/vip-quickstart)
define line($file, $line, $ensure = 'present') {
case $ensure {
default : { err ( "unknown ensure value ${ensure}" ) }
present: {
exec { "/bin/echo '${line}' >> '${file}'":
unless => "/bin/grep -qFx '${line}' '${file}'"
}
}
absent: {
exec { "/usr/bin/perl -ni -e 'print unless /^\\Q${line}\\E\$/' '${file}'":
onlyif => "/bin/grep -qFx '${line}' '${file}'"
}
}
}
}

+ 0
- 14
provision/manifests/init.pp View File

@@ -1,14 +0,0 @@
import 'helpers/*.pp'

group { 'puppet': ensure => present }

Exec { path => [ '/bin/', '/sbin/', '/usr/bin/', '/usr/sbin/', '/vagrant/provision/bin/' ] }
File { owner => 0, group => 0, mode => 0644 }

import 'components/system.pp'
import 'components/repos.pp'
import 'components/apache.pp'
import 'components/php.pp'
import 'components/mysql.pp'
import 'components/www.pp'
import 'components/wordpress.pp'

provision/manifests/repeat.pp → user-data/vhosts/01_init.pp View File

@@ -1,5 +1,3 @@
import 'helpers/*.pp'

group { 'puppet': ensure => present }

Exec { path => [ '/bin/', '/sbin/', '/usr/bin/', '/usr/sbin/', '/vagrant/provision/bin/' ] }
@@ -8,5 +6,3 @@ File { owner => 0, group => 0, mode => 0644 }
include '::php'
include '::apache'
include '::mysql::server'

import '/vagrant/user-data/vhosts/*.pp'

+ 0
- 0
user-data/vhosts/hold.pp View File