Skip to content

Instantly share code, notes, and snippets.

@arnisoph
Last active September 10, 2015 18:41
Show Gist options
  • Save arnisoph/90d6a0d1de6fa5416d77 to your computer and use it in GitHub Desktop.
Save arnisoph/90d6a0d1de6fa5416d77 to your computer and use it in GitHub Desktop.
cfg-mgmt-declarative-model-programming
user {'admin_user':
ensure => present,
name => 'john',
shell => '/bin/zsh',
managehome => true,
require => Package['apache_package'],
before => File['html_doc'],
}
service {'apache_service':
ensure => running,
name => 'apache2',
require => File['html_doc'],
}
package {'apache_package':
ensure => installed,
name => 'apache2',
version => 'latest',
before => User['admin_user'],
}
file {'html_doc':
ensure => file,
name => '/var/www/index.html',
owner => 'john',
group => 'admins',
mode => 644,
content => 'Hello World!',
before => Service['apache_service'],
require => User['admin_user'],
}
install_apache:
package.installed:
- name: apache2
- version: latest
add_admin_user:
user.present:
- name: john
- shell: /bin/zsh
- createhome: True
add_html_doc:
file.managed:
- name: /var/www/index.html
- user: john
- group: admins
- mode: 644
- contents: 'Hello World!'
start_apache:
service.running:
- name: apache2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment