Commit 697b8401 authored by Dan Thomson's avatar Dan Thomson

[#1] Plone successfully installs

parent 1356bfb4
Pipeline #2599 failed with stage
in 52 seconds
......@@ -2,9 +2,10 @@ plone_version: 5.1.2
plone_install_method: null
plone_install_path: "/opt/plone/{{ plone_version }}"
plone_instance_name: null
plone_var_path: "{{ install_path }}/{{ instance_name }}/var"
plone_var_path: "{{ plone_install_path }}/{{ plone_instance_name }}/var"
plone_admin_password: abc123
plone_user: plone
plone_group: plone
plone_port: 8080
plone_zeo_address: 127.0.0.1:8100
debug: false
- name: Install Software Collections Repo
yum:
name: scl-utils centos-release-scl-rh
state: latest
become: yes
- name: Install dependency packages
yum:
name: "{{ package }}"
state: latest
update_cache: yes
with_items: "{{ packages }}"
loop_control:
loop_var: package
become: yes
- name: Enable python27 from scl
command: scl enable python27 bash
become: yes
......@@ -22,7 +22,13 @@
loop_control:
loop_var: file
- name: Look for the destination path
stat:
path: "{{ plone_install_path }}/{{ plone_instance_name }}"
register: plone_stat
- name: Download the Plone installer
when: plone_stat.stat.exists == False
block:
- name: Create tmpdir for Plone
tempfile:
......@@ -31,31 +37,57 @@
- name: Extract Plone installer into tmpdir
unarchive:
src: "https://launchpad.net/plone/{{ plone_version | regex_replace('(\d+)\.(\d+)\.\(\d+)$', '\1.\2') }}/{{ plone_version }}/+download/Plone-{{ plone_version }}-UnifiedInstaller.tgz"
src: "https://launchpad.net/plone/{{ plone_version | regex_replace('(\\d+)\\.(\\d+)\\.(\\d+)$', '\\1.\\2') }}/{{ plone_version }}/+download/Plone-{{ plone_version }}-UnifiedInstaller.tgz"
dest: "{{ tmpdir.path }}"
remote_src: yes
- name: Create plone destination path since the installer can't figure it out
file:
path: "{{ plone_install_path }}"
state: directory
owner: root
group: root
mode: 0755
become: yes
- name: Run the Plone installer
command: ./install.sh --target={{ plone_install_path }} --instance={{ plone_instance_name }} --var={{ plone_var_path }} --password={{ plone_admin_password }} --owner={{ plone_user }} --group={{ plone_group }} --with-python=/usr/bin/python {% if plone_install_method == 'standalone' %}standalone{% elif plone_install_method == 'zeo' %}zeo{% elif plone_install_method == 'none' %}none{% endif %}
command: ./install.sh --target={{ plone_install_path }} --instance={{ plone_instance_name }} --var={{ plone_var_path }} --password={{ plone_admin_password }} --owner={{ plone_user }} --group={{ plone_group }} --build-python {% if plone_install_method == "standalone" %}standalone{% elif plone_install_method == "zeo" %}zeo{% elif plone_install_method == "none" %}none{% endif %}
args:
chdir: "{{ tmpdir.path }}"
chdir: "{{ tmpdir.path }}/Plone-{{ plone_version }}-UnifiedInstaller"
register: install_command
failed_when: '"aborting install" in install_command.stdout'
become: yes
- name: Look for the destination path
stat:
path: "{{ plone_install_path }}/{{ plone_instance_name }}"
register: plone_stat_new
- name: Die if plone wasn't installed (the install script will "succeed" even when it fails)
fail:
msg: "Nothing found at the installation destination path"
when: plone_stat_new and plone_stat_new.stat.exists == False
always:
- name: Fix plone directory ownership
file:
path: "{{ plone_install_path }}"
state: directory
owner: "{{ plone_user }}"
group: "{{ plone_group }}"
mode: 0755
- name: Cleanup tmpdir
file:
path: "{{ tmpdir.path }}"
state: absent
when: debug == False
become: yes
- name: Update the plone port in buildout.cfg
lineinfile:
path: "{{ plone_install_path }}/{{ instance_name }}/buildout.cfg"
path: "{{ plone_install_path }}/{{ plone_instance_name }}/buildout.cfg"
regexp: '^\s*http-address\s*=\s*'
line: "http-address = {{ plone_port }}"
register: port_update
become: yes
- name: Rerun buildout
command: "{{ plone_install_path }}/{{ instance_name }}/bin/buildout" -c "{{ plone_install_path }}/{{ plone_instance_name }}/buildout.cfg"
command: "{{ plone_install_path }}/{{ plone_instance_name }}/bin/buildout -c {{ plone_install_path }}/{{ plone_instance_name }}/buildout.cfg"
when: port_update.changed
become: yes
become_user: "{{ plone_user }}"
......@@ -10,8 +10,7 @@ packages:
- patch
- poppler-devel
- poppler-utils
- python27-devel
- python-setuptools
- readline-devel
- sudo
- which
- zlib-devel
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment