carve out fetsite
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
# The last ruby listed will be set as the default ruby
|
||||
rvm1_rubies:
|
||||
- '2.1.0'
|
||||
- '2.3.1'
|
||||
|
||||
|
||||
# Install bundler
|
||||
rvm1_bundler_install: True
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
ssh_key_bits: 4096
|
||||
ssh_key_file: .ssh/id_rsa
|
||||
|
||||
|
||||
- name: install rvm prerequires
|
||||
apt: pkg="{{ item }}" cache_valid_time=3600 update_cache=yes state=present
|
||||
with_items: "{{ ruby_req_packages }}"
|
||||
@@ -20,12 +21,37 @@
|
||||
become: yes
|
||||
become_user: "{{ rvm1_user }}"
|
||||
|
||||
- name: Install ruby requirements
|
||||
command: '{{ rvm1_rvm }} requirements'
|
||||
changed_when: False
|
||||
#- name: Install ruby requirements
|
||||
# command: '{{ rvm1_rvm }} install requirements'
|
||||
# changed_when: False
|
||||
# when: rvm1_rubies
|
||||
|
||||
|
||||
- name: Install rubies
|
||||
command: '/home/{{ rvm1_user }}/.rvm/bin/rvm install requirements'
|
||||
when: rvm1_rubies
|
||||
|
||||
|
||||
- name: Detect if rubies are installed
|
||||
command: '/home/{{ rvm1_user }}/.rvm/bin/rvm {{ item }} do true'
|
||||
changed_when: False
|
||||
failed_when: False
|
||||
register: detect_rubies
|
||||
with_items: '{{ rvm1_rubies }}'
|
||||
when: rvm1_rubies
|
||||
|
||||
- name: remove rvm prerq
|
||||
apt: pkg="libssl-dev" state=absent
|
||||
- name: remove rvm prerq
|
||||
apt: pkg="libssl1.0-dev" state=present
|
||||
|
||||
|
||||
#- name: Install rubies
|
||||
# command: '/home/{{ rvm1_user }}/.rvm/bin/rvm install {{ item.item }} {{ rvm1_ruby_install_flags }}'
|
||||
# when: rvm1_rubies and item.rc|default(0) != 0
|
||||
# with_items: '{{ detect_rubies.results }}'
|
||||
|
||||
|
||||
- name: Install Ruby and Gems
|
||||
include: 'rubies.yml'
|
||||
become: yes
|
||||
@@ -33,44 +59,6 @@
|
||||
|
||||
|
||||
|
||||
- name: "create directory for {{item.name}}"
|
||||
file:
|
||||
path: "{{item.dest}}"
|
||||
state: directory
|
||||
owner: "{{ rvm1_user }}"
|
||||
group: "{{ rvm1_user }}"
|
||||
with_items: "{{ruby_sites}}"
|
||||
|
||||
|
||||
- name: Template for InitScript
|
||||
template:
|
||||
src: ruby_fetsite.j2
|
||||
dest: "{{site.dest}}/../{{site.script}}"
|
||||
owner: "{{ rvm1_user }}"
|
||||
group: "{{ rvm1_user }}"
|
||||
mode: "u=rwx,g=rwx,o=r"
|
||||
when: not(site.script is undefined)
|
||||
with_items: "{{ruby_sites}}"
|
||||
loop_control:
|
||||
loop_var: site
|
||||
|
||||
|
||||
- name: Deploying sites
|
||||
include: site.yml
|
||||
become: yes
|
||||
become_user: "{{ rvm1_user }}"
|
||||
with_items: "{{ruby_sites}}"
|
||||
loop_control:
|
||||
loop_var: site
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -30,16 +30,3 @@
|
||||
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 }}"
|
||||
|
||||
- include_tasks: fetsite.yml
|
||||
when: not(site.ruby_init is undefined) and site.ruby_init
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
#!/bin/bash
|
||||
echo "sdf"
|
||||
echo "{{site}}"
|
||||
source ~/.rvm/scripts/rvm
|
||||
source $({{rvm1_rvm}} {{site.ruby}} do rvm gemset create {{site.gemset}})
|
||||
|
||||
source $({{rvm1_rvm}} {{site.ruby}}@{{site.gemset}} do rvm env --path)
|
||||
which ruby
|
||||
gem install bundler
|
||||
bundle install
|
||||
rvm gemset list
|
||||
ruby -v
|
||||
|
||||
#ruby -v
|
||||
Reference in New Issue
Block a user