Last active
September 10, 2015 18:41
-
-
Save arnisoph/90d6a0d1de6fa5416d77 to your computer and use it in GitHub Desktop.
cfg-mgmt-declarative-model-programming
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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'], | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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