fetsite installation

This commit is contained in:
Andreas Stephanides
2017-12-08 08:56:02 +01:00
parent 94a7827cf2
commit d34a747668
10 changed files with 324 additions and 72 deletions

View File

@@ -1,66 +1,45 @@
# Deploy a ruby site
# item:
# name: Seite
# git:
# repo: https://git_repository
# dest: destination on server
---
- debug:
msg: "Seite: {{item.name}}"
msg: "deploy ruby site: {{site.name}}"
- command: whoami
register: whoami
- command: echo "$PATH"
register: out
changed_when: false
- debug: msg="{{ out.stdout }}"
- debug: msg="{{ whoami.stdout }}"
- name: "DIR"
file:
path: "{{item.git.dest}}"
state: directory
owner: "ruby"
group: "ruby"
- name: Clone GIT
become_user: "ruby"
- name: "cloning git repository from {{site.git.repo}}"
git:
repo: "{{item.git.repo}}"
dest: "{{item.git.dest}}"
repo: "{{site.git.repo}}"
dest: "{{site.dest}}"
- name: ruby init
command: 'echo "$PATH"'
become_user: "ruby"
changed_when: false
args:
chdir: "{{item.git.dest}}"
chdir: "{{site.dest}}"
environment:
PATH: "{{ rvm1_install_path }}/wrappers/default:{{ ansible_env.PATH }}"
register: out
- name: run_initscript
command: '../{{site.script}}'
args:
chdir: "{{site.dest}}"
register: out
environment:
PATH: "{{ rvm1_install_path }}/bin:{{ rvm1_install_path }}/wrappers/ruby-{{site.ruby}}@{{site.gemset}}:{{ ansible_env.PATH }}"
- debug: msg="{{ out.stdout_lines }}"
- name: ls
command: ls .
become_user: "ruby"
args:
chdir: "{{item.git.dest}}"
register: out
- debug: msg="{{ out.stdout_lines }}"
- shell: ./initscript.sh
become_user: "ruby"
args:
chdir: "{{item.git.dest}}"
register: output
when: not(item.ruby_init is undefined) and item.ruby_init
- debug:
msg:"{{output}}"
- name: ruby init
command: 'echo initscript.sh | /bin/bash --login'
become_user: "ruby"
args:
chdir: "{{item.git.dest}}"
register: output
when: not(item.ruby_init is undefined) and item.ruby_init
- debug:
msg:"{{output}}"
- include_tasks: fetsite.yml
when: not(site.ruby_init is undefined) and site.ruby_init