solar/bootstrap/playbooks/solar.yaml
Bogdan Dobrelya 542a359af2 Add vbox/qemu packer build for centos7
Rename the cloud_archive task to uca/rdo tasks for ubuntu/centos
Rename the worker_upstrart task to the worker
Rework the OSTYPE env var to "when: ansible_os_family"

TODO
* PXE (PREPROVISIONED=false) to be working for centos as well
* pygraphviz for centos7, see also https://bugs.launchpad.net/fuel/+bug/1510884
* fix ubuntu only compatible examples, for example riak cluster deploy

Closes-bug: 1553988

Change-Id: Iab130c3c79b3db99deb14ea50572c073532f4694
Signed-off-by: Bogdan Dobrelya <bdobrelia@mirantis.com>
2016-03-16 11:41:15 +01:00

75 lines
2.6 KiB
YAML

---
- hosts: localhost
become: yes
vars:
ssh_ip_mask: "10.*.*.*"
tasks:
# upgrade pbr first, old version throws strange errors
- shell: pip install pbr -U
# Setup development env for solar
- shell: pip install -e . chdir=/vagrant
- shell: pip install git+git://github.com/Mirantis/solar-agent.git
- include: centos/tasks/ssh_conf.yaml
when: ansible_os_family == "RedHat"
- include: ubuntu/tasks/ssh_conf.yaml
when: ansible_os_family == "Debian"
- hosts: localhost
tasks:
# setup solar-resources
# change to openstack/solar-resources later
- git: repo=https://github.com/openstack/solar-resources.git version=0.2.0 dest=/vagrant/solar-resources update=no
- shell: 'mount|grep " /vagrant"'
register: vagrant_mounted
ignore_errors: True
- file: path=/vagrant/solar-resources owner=vagrant group=vagrant recurse=yes
when: vagrant_mounted|failed
- shell: pip install gevent
# set default config location
- lineinfile:
dest: /home/vagrant/.bashrc
line: export SOLAR_CONFIG="/vagrant/.config"
state: present
# create custom config file /vagrant/.solar_config_override for vagrant env
- file: path=/.solar_config_override state=touch mode=0644
- lineinfile:
dest: /.solar_config_override
line: "log_file: /var/log/solar/solar.log"
state: present
create: yes
- lineinfile:
dest: /.solar_config_override
line: "counter_bucket_type: counters"
state: present
create: yes
- lineinfile:
dest: /home/vagrant/.bashrc
line: export PYTHONWARNINGS="ignore"
state: present
# make riak default on vagrant env
- lineinfile:
dest: /home/vagrant/.bashrc
line: export SOLAR_CONFIG_OVERRIDE="/.solar_config_override"
state: present
- lineinfile:
dest: /home/vagrant/.bashrc
line: eval "$(_SOLAR_COMPLETE=source solar)"
state: present
- file: path=/var/log/solar state=directory owner=vagrant
- file: path=/var/lib/solar/repositories state=directory owner=vagrant
- file: src=/vagrant/solar-resources/resources dest=/var/lib/solar/repositories/resources state=link owner=vagrant
- file: src=/vagrant/solar-resources/templates dest=/var/lib/solar/repositories/templates state=link owner=vagrant
# shared stuff for all databases
- include: databases.yaml
- include: centos/tasks/worker.yaml
when: ansible_os_family == "RedHat"
- include: ubuntu/tasks/worker.yaml
when: ansible_os_family == "Debian"