From d60f080504cb906d7e91b665c36d6e8d692d79ca Mon Sep 17 00:00:00 2001 From: Dominic Banks <35109375+Piersman@users.noreply.github.com> Date: Mon, 27 Jul 2020 13:04:08 +0100 Subject: [PATCH] Add basic playbook #4 Play book installs needed dependencies and the python virtual environment --- playbook.yaml | 54 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 playbook.yaml diff --git a/playbook.yaml b/playbook.yaml new file mode 100644 index 0000000..1e18e49 --- /dev/null +++ b/playbook.yaml @@ -0,0 +1,54 @@ +- name: Playbook to install the doi_site software + hosts: 127.0.0.1 + become: yes + connection: local + tasks: + - name: Install python-virtualenv is installed + yum: + name: virtualenv + state: latest + + - name: Install the correct verison of gcc + yum: + name: gcc + state: latest + + - name: Install the correct verison of mod_ssl.x86_64 + yum: + name: mod_ssl.x86_64 + state: latest + + - name: Ensure we have the correct verison of Apache + yum: + name: httpd + state: latest + + - name: Install the correct verison of mod_wsgi.x86_64 + yum: + name: python3-mod_wsgi.x86_64 + state: latest + + - name: Install the correct verison of openldap-devel + yum: + name: openldap-devel + state: latest + + - name: Create the directory for static files + file: + path: /var/www/html/doi + state: directory + mode: '0755' + + - name: Create the directory for sqlite database + file: + path: /var/doi + state: directory + mode: '0755' + + - name: Create the python virtual environment + command: + cmd: virtualenv /opt/doi + creates: "/opt/doi" + + - name: Finish creating the virual environment + shell: "source /opt/doi/bin/activate; export DJANGO_PROJECT_STATIC_FILES=/var/www/html/doi/; pip install doi_site"