Setting up chocolatey to install windows packages
This commit is contained in:
		
							parent
							
								
									dc383093e5
								
							
						
					
					
						commit
						b88c7cc172
					
				@ -26,6 +26,9 @@ mod 'puppetlabs-dism', '1.3.1'
 | 
			
		||||
mod 'puppetlabs-dsc', '1.9.4'
 | 
			
		||||
mod 'puppetlabs-acl', '3.1.0'
 | 
			
		||||
mod 'puppetlabs-iis', '7.0.0'
 | 
			
		||||
mod 'puppetlabs-pwshlib', '0.4.0'
 | 
			
		||||
mod 'puppet-archive', '4.4.0'
 | 
			
		||||
mod 'puppet-staging', '3.2.0'
 | 
			
		||||
 | 
			
		||||
# Modules from Git
 | 
			
		||||
# Examples: https://github.com/puppetlabs/r10k/blob/master/doc/puppetfile.mkd#examples
 | 
			
		||||
 | 
			
		||||
@ -1,5 +0,0 @@
 | 
			
		||||
class os::win {
 | 
			
		||||
  if $facts[osfamily] == 'windows' {
 | 
			
		||||
    include role::custom_windows
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
@ -34,7 +34,13 @@ node default {
 | 
			
		||||
 | 
			
		||||
    if $trusted['extensions']['pp_role'] {
 | 
			
		||||
      include "role::${trusted['extensions']['pp_role']}"
 | 
			
		||||
    
 | 
			
		||||
#      if $facts[osfamily] == 'windows' {
 | 
			
		||||
#        include role::custom_windows
 | 
			
		||||
#        Package { provider => chocolatey, }
 | 
			
		||||
#      }
 | 
			
		||||
 | 
			
		||||
    } else {
 | 
			
		||||
      include role::node
 | 
			
		||||
  }
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@ -1,7 +1,8 @@
 | 
			
		||||
class profile::custom_windows (
 | 
			
		||||
  Boolean $add_user = true,
 | 
			
		||||
  Boolean $config_server = true,
 | 
			
		||||
) {
 | 
			
		||||
  if $add_user {
 | 
			
		||||
    class { '::profile::custom_windows::add_user': }
 | 
			
		||||
  if $config_server {
 | 
			
		||||
    class { '::profile::custom_windows::config_server': }
 | 
			
		||||
    include chocolatey
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
										
											Binary file not shown.
										
									
								
							@ -1,4 +1,4 @@
 | 
			
		||||
class profile::custom_windows::add_user (
 | 
			
		||||
class profile::custom_windows::config_server (
 | 
			
		||||
 | 
			
		||||
  $user_name     = 'myuser',
 | 
			
		||||
  $user_group    = 'mygroup',
 | 
			
		||||
@ -54,4 +54,8 @@ class profile::custom_windows::add_user (
 | 
			
		||||
     data  => '1',
 | 
			
		||||
     type  => 'dword',
 | 
			
		||||
   }
 | 
			
		||||
 | 
			
		||||
    class {'chocolatey':
 | 
			
		||||
      log_output             => true,
 | 
			
		||||
    }  
 | 
			
		||||
}
 | 
			
		||||
@ -0,0 +1,83 @@
 | 
			
		||||
class profile::custom_windows::config_server (
 | 
			
		||||
 | 
			
		||||
  $user_name     = 'myuser',
 | 
			
		||||
  $user_group    = 'mygroup',
 | 
			
		||||
  $user_groups   = ['BUILTIN\Administrators', 'BUILTIN\Users'],
 | 
			
		||||
  $user_home     = "C:\Users\myuser",
 | 
			
		||||
  $user_password = 'puppet',
 | 
			
		||||
  $ensure        = 'present',
 | 
			
		||||
  $manage_home   = true,
 | 
			
		||||
  $user_file     = 'myfile',
 | 
			
		||||
 | 
			
		||||
) {
 | 
			
		||||
 | 
			
		||||
  profile::custom_windows::define_user { 'myuser':
 | 
			
		||||
 | 
			
		||||
    user_name     => $user_name,
 | 
			
		||||
    user_group    => $user_group,
 | 
			
		||||
    user_groups   => $user_groups,
 | 
			
		||||
    user_home     => $user_home,
 | 
			
		||||
    user_password => $user_password,
 | 
			
		||||
    ensure        => $ensure,
 | 
			
		||||
    manage_home   => $manage_home,
 | 
			
		||||
    user_file     => $user_file,
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  acl { 'C:\\Users\\myuser\myfile':
 | 
			
		||||
 | 
			
		||||
    permissions => [
 | 
			
		||||
    { identity => $user_name, rights => ['read','execute'] },
 | 
			
		||||
    { identity => $user_group, rights => ['read'] }
 | 
			
		||||
   ],
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  registry::value { 'Enable IEESC':
 | 
			
		||||
 | 
			
		||||
    key   => 'HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Active Setup\Installed Components\{A509B1A7-37EF-4b3f-8CFC-4F3A74704073}',
 | 
			
		||||
    value => 'IsInstalled',
 | 
			
		||||
    data  => '1',
 | 
			
		||||
    type  => 'dword',
 | 
			
		||||
  }  
 | 
			
		||||
 | 
			
		||||
  registry::value { 'Enable shutdown tracker':
 | 
			
		||||
 | 
			
		||||
    key   => 'HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Reliability',
 | 
			
		||||
    value => 'ShutdownReasonOn',
 | 
			
		||||
    data  => '1',
 | 
			
		||||
    type  => 'dword',
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
 registry::value { 'Enable shutdown tracker UI':
 | 
			
		||||
 | 
			
		||||
   key   => 'HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Reliability',
 | 
			
		||||
   value => 'ShutdownReasonUI',
 | 
			
		||||
   data  => '1',
 | 
			
		||||
   type  => 'dword',
 | 
			
		||||
 }
 | 
			
		||||
 | 
			
		||||
  class {'chocolatey':
 | 
			
		||||
    log_output              => true,
 | 
			
		||||
    choco_install_location  => 'c:\choco',
 | 
			
		||||
  }  
 | 
			
		||||
 
 | 
			
		||||
  chocolateysource {'custom_source':
 | 
			
		||||
    ensure   => present,
 | 
			
		||||
    location => 'c:\packages',
 | 
			
		||||
    provider => windows,
 | 
			
		||||
  }
 | 
			
		||||
 
 | 
			
		||||
  chocolateyfeature {'allowEmptyChecksums':
 | 
			
		||||
    ensure   => enabled,
 | 
			
		||||
    provider => windows,
 | 
			
		||||
  }
 | 
			
		||||
 
 | 
			
		||||
  chocolateyconfig {'cacheLocation':
 | 
			
		||||
    value    => 'c:\ProgramData\choco-cache',
 | 
			
		||||
    provider => windows,
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  package { '7zip':
 | 
			
		||||
    ensure            => '19.0',
 | 
			
		||||
    provider          => 'chocolatey',
 | 
			
		||||
  }   
 | 
			
		||||
}
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user