This commit is contained in:
Andreas Stephanides
2017-12-08 08:54:53 +01:00
parent 7de8536297
commit 63fd99277b
7 changed files with 83 additions and 25 deletions

View File

@@ -1,26 +1,69 @@
# 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: {{item.name}}"
- command: whoami
register: whoami
changed_when: false
- debug: msg="{{ whoami.stdout }}"
- name: "DIR"
- name: "create directory for {{item.name}}"
file:
path: "/srv/intern"
path: "{{item.git.dest}}"
state: directory
owner: "ruby"
group: "ruby"
- name: Clone GIT
- name: "cloning git repository from {{item.git.repo}}"
become_user: "ruby"
git:
repo: "{{item.git.repo}}"
dest: "{{item.git.dest}}"
- name: ruby init
command: 'echo "$PATH"'
become_user: "ruby"
args:
chdir: "{{item.git.dest}}"
register: out
- 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}}"