Start ansible example to deplay a dolibarr instance on a linux server
This commit is contained in:
parent
62e1c55c97
commit
afaed832b1
21
dev/ansible/deployplaybook/demo.yml
Normal file
21
dev/ansible/deployplaybook/demo.yml
Normal file
@ -0,0 +1,21 @@
|
||||
#!/usr/bin/env ansible-playbook
|
||||
|
||||
- name: Configure webserver with apache
|
||||
hosts: webservers
|
||||
sudo: True
|
||||
tasks:
|
||||
- name: install apache
|
||||
apt: name=apache update_cache=yes
|
||||
- name: copy apache config file
|
||||
copy: src=files/apachealias.conf dest=/etc/apache/conf.d/dolibarr_dev
|
||||
#- name: enable configuration
|
||||
# file: >
|
||||
# dest=/etc/apache/sites-enabled/default
|
||||
# src=/etc/apache/sites-available/default
|
||||
# state=link
|
||||
- name: copy info.html
|
||||
template: src=templates/info.html.j2 dest=/var/www/dolibarr_dev/info.html
|
||||
mode=0644
|
||||
- name: restart apache
|
||||
service: name=apache state=restarted
|
||||
|
||||
2
dev/ansible/deployplaybook/files/apachealias.conf
Normal file
2
dev/ansible/deployplaybook/files/apachealias.conf
Normal file
@ -0,0 +1,2 @@
|
||||
|
||||
Alias /dolibarr_dev /var/www/dolibarr
|
||||
2
dev/ansible/deployplaybook/hosts
Normal file
2
dev/ansible/deployplaybook/hosts
Normal file
@ -0,0 +1,2 @@
|
||||
[webservers]
|
||||
testserver ansible_ssh_host=127.0.0.1 ansible_ssh_port=22
|
||||
10
dev/ansible/deployplaybook/templates/info.html.j2
Normal file
10
dev/ansible/deployplaybook/templates/info.html.j2
Normal file
@ -0,0 +1,10 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>Page info ansible</title>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Apache, configured by Ansible</h1>
|
||||
<p>If you can see this, Ansible successfully installed apache.</p>
|
||||
<p>{{ ansible_managed }}</p>
|
||||
</body>
|
||||
</html>
|
||||
Loading…
Reference in New Issue
Block a user