diff options
author | Thedro Neely <thedroneely@gmail.com> | 2019-12-19 11:14:42 -0500 |
---|---|---|
committer | Thedro Neely <thedroneely@gmail.com> | 2019-12-19 11:14:42 -0500 |
commit | c63266aec7a979e65f213606450dc1c152e73c39 (patch) | |
tree | a66a0289552f3056c8b7bd4d878beb9488329140 /roles/isso/main.yml | |
parent | d47cbe82b2653a3c4fa165dc155d7433f01fe314 (diff) | |
download | playbooks-c63266aec7a979e65f213606450dc1c152e73c39.tar.gz playbooks-c63266aec7a979e65f213606450dc1c152e73c39.tar.bz2 playbooks-c63266aec7a979e65f213606450dc1c152e73c39.zip |
roles: Rename entrypoint to main.yml
Diffstat (limited to 'roles/isso/main.yml')
-rw-r--r-- | roles/isso/main.yml | 107 |
1 files changed, 107 insertions, 0 deletions
diff --git a/roles/isso/main.yml b/roles/isso/main.yml new file mode 100644 index 0000000..7768b49 --- /dev/null +++ b/roles/isso/main.yml @@ -0,0 +1,107 @@ +--- +- hosts: isso + vars: + username: isso + deploy_path: "/opt/{{ username }}" + version: 7eed747e7a94ca1a19c01c67de7ed6b16d2bbe3d + tasks: + - name: Ensuring group exists + group: + name: "{{ username }}" + state: present + - name: Creating user and making home directory + user: + system: yes + state: present + name: "{{ username }}" + groups: "{{ username }}" + home: "/opt/{{ username }}" + - 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 repository + git: + repo: https://github.com/posativ/isso + dest: "{{ deploy_path }}" + version: "{{ version }}" + - 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 config file + copy: + src: isso.conf + dest: "{{ deploy_path }}/isso.conf" + owner: "{{ username }}" + group: "{{ username }}" + mode: '0644' + register: issoConfig + become: true + become_user: "{{ username }}" + - 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 |