Start ansible example to deplay a dolibarr instance on a linux server

This commit is contained in:
Laurent Destailleur 2015-05-19 14:14:17 +02:00
parent 62e1c55c97
commit afaed832b1
4 changed files with 35 additions and 0 deletions

View 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

View File

@ -0,0 +1,2 @@
Alias /dolibarr_dev /var/www/dolibarr

View File

@ -0,0 +1,2 @@
[webservers]
testserver ansible_ssh_host=127.0.0.1 ansible_ssh_port=22

View 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>