aboutsummaryrefslogtreecommitdiff
path: root/ansible/odoo
diff options
context:
space:
mode:
authorTrygve Laugstøl <trygvis@inamo.no>2019-06-19 21:43:58 +0200
committerTrygve Laugstøl <trygvis@inamo.no>2019-08-08 09:03:13 +0200
commitb3b131a172bb66fa97146edb1ea83923339b364a (patch)
tree3f3cf07062d1968d3ab030cb807f38791f0f6a85 /ansible/odoo
parent8dd666905a660b65e79920131b676e7e9c57773e (diff)
downloadinfra-b3b131a172bb66fa97146edb1ea83923339b364a.tar.gz
infra-b3b131a172bb66fa97146edb1ea83923339b364a.tar.bz2
infra-b3b131a172bb66fa97146edb1ea83923339b364a.tar.xz
infra-b3b131a172bb66fa97146edb1ea83923339b364a.zip
o Adding odoo configuration for numquam.
Diffstat (limited to 'ansible/odoo')
-rw-r--r--ansible/odoo/odoo.yml48
1 files changed, 48 insertions, 0 deletions
diff --git a/ansible/odoo/odoo.yml b/ansible/odoo/odoo.yml
new file mode 100644
index 0000000..0097294
--- /dev/null
+++ b/ansible/odoo/odoo.yml
@@ -0,0 +1,48 @@
+- hosts:
+ - numquam
+ tasks:
+ - become: yes
+ copy:
+ dest: /etc/systemd/system/docker.odoo.service
+ content: |
+ [Unit]
+ After=docker.service
+ Requires=docker.service
+
+ [Service]
+ TimeoutStartSec=0
+ Restart=always
+ ExecStartPre=-/usr/bin/docker stop odoo
+ ExecStartPre=-/usr/bin/docker rm odoo
+ ExecStartPre=/usr/bin/docker pull odoo
+ ExecStart=/usr/bin/docker run \
+ -e HOST=172.17.0.1 \
+ -e PORT=5432 \
+ -e USER=odoo \
+ -e PASSWORD=odoo \
+ -p 8069:8069 \
+ --name odoo -t \
+ odoo
+
+ [Install]
+ WantedBy=multi-user.target
+ register: service_file
+
+ - become: yes
+ systemd:
+ daemon_reload: yes
+ when: service_file.changed
+
+ - become: yes
+ systemd:
+ unit: docker.odoo.service
+ enabled: yes
+ state: started
+ when: not service_file.changed
+
+ - become: yes
+ systemd:
+ unit: docker.odoo.service
+ enabled: yes
+ state: restarted
+ when: service_file.changed