diff options
author | Thedro Neely <thedroneely@gmail.com> | 2019-12-18 14:49:30 -0500 |
---|---|---|
committer | Thedro Neely <thedroneely@gmail.com> | 2019-12-18 14:49:30 -0500 |
commit | 14b53bebf6313349a5082f35679b9841ec7f1ed0 (patch) | |
tree | 396e5c1120706e6cde91dfe8e098c0524ee97629 | |
download | playbooks-14b53bebf6313349a5082f35679b9841ec7f1ed0.tar.gz playbooks-14b53bebf6313349a5082f35679b9841ec7f1ed0.tar.bz2 playbooks-14b53bebf6313349a5082f35679b9841ec7f1ed0.zip |
roles/isso/isso.yml: Add isso
-rw-r--r-- | roles/isso/isso.yml | 105 |
1 files changed, 105 insertions, 0 deletions
diff --git a/roles/isso/isso.yml b/roles/isso/isso.yml new file mode 100644 index 0000000..5cf3488 --- /dev/null +++ b/roles/isso/isso.yml @@ -0,0 +1,105 @@ +--- +- hosts: isso + vars: + deploy_path: /opt/isso/deploy + tasks: + - name: Ensuring isso group exists + group: + name: isso + state: present + - name: Creating isso user and making home directory + user: + system: yes + state: present + name: isso + groups: isso + home: /opt/isso + - name: Installing the required dependencies + apk: + state: present + update_cache: yes + name: + - sudo + - git + - gcc + - python3-dev + - musl-dev + - libffi-dev + - npm + - make + - supervisor + - block: + - name: Cloning isso repository + git: + repo: https://github.com/posativ/isso + dest: "{{ deploy_path }}" + version: 7eed747e7a94ca1a19c01c67de7ed6b16d2bbe3d + - name: Setting up python virtual environment + shell: python3 -m venv . + args: + chdir: "{{ deploy_path }}" + creates: bin/activate + - name: Setting up build environment + shell: | + . bin/activate + python setup.py develop + args: + chdir: "{{ deploy_path }}" + creates: isso.egg-info + - name: Installing JavaScript dependencies + shell: npm install bower requirejs jade + args: + chdir: "{{ deploy_path }}" + creates: node_modules/.bin + - name: Building JavaScript assets + shell: | + PATH=$PATH:"{{ deploy_path }}"/node_modules/.bin + make init + make js + args: + chdir: "{{ deploy_path }}" + creates: isso/js/embed.min.js + - name: Copying isso config file + copy: + src: isso.conf + dest: "{{ deploy_path }}/isso.conf" + owner: isso + group: isso + mode: '0644' + register: issoConfig + become: true + become_user: isso + - name: Copying supervisord config file + copy: + src: supervisord.conf + dest: /etc/supervisord.conf + owner: root + group: root + mode: '0644' + register: supervisorConfig + - name: Ensuring supervisord has been started + service: + name: supervisord + state: started + - name: Restarting supervisord due to config change + service: + name: supervisord + state: restarted + when: supervisorConfig.changed + - name: Ensuring isso has been started + supervisorctl: + name: isso + state: started + - name: Restarting isso due to config change + supervisorctl: + name: isso + state: restarted + when: issoConfig.changed + - name: Testing if isso admin page exists + uri: + url: http://0.0.0.0:8100/admin + return_content: yes + - name: Testing if isso JavaScript exists + uri: + url: http://0.0.0.0:8100/js/embed.min.js + return_content: yes
\ No newline at end of file |