Files
Andreas Stephanides 63fd99277b fixes
2017-12-08 08:54:53 +01:00

69 lines
1.3 KiB
YAML

# Deploy a ruby site
# item:
# name: Seite
# git:
# repo: https://git_repository
# dest: destination on server
---
- debug:
msg: "deploy ruby site: {{item.name}}"
- command: whoami
register: whoami
changed_when: false
- debug: msg="{{ whoami.stdout }}"
- name: "create directory for {{item.name}}"
file:
path: "{{item.git.dest}}"
state: directory
owner: "ruby"
group: "ruby"
- 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}}"