This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

Ansible 2.0 compatibility

  • Loading branch information...
BR0kEN- committed Jan 17, 2016
1 parent 97de51c commit 04074678f3533e7325d241a4349f3c992edc7f92
Showing with 43 additions and 200 deletions.
  1. +4 −0 cibox
  2. +0 −2 cmf/all/scripts/tasks/database/import.yml
  3. +1 −1 cmf/drupal/7/scripts/reinstall.yml
  4. +2 −2 cmf/drupal/7/scripts/sniffers.yml
  5. +1 −1 cmf/drupal/7/scripts/tasks/drush/commands.yml
  6. +1 −1 cmf/drupal/7/scripts/tasks/drush/features.yml
  7. +1 −1 cmf/drupal/7/scripts/tasks/drush/modules.yml
  8. +1 −1 cmf/drupal/7/scripts/tasks/drush/rr.yml
  9. +1 −1 cmf/drupal/7/scripts/tasks/drush/si.yml
  10. +1 −1 cmf/drupal/7/scripts/tasks/drush/updb.yml
  11. +1 −1 cmf/drupal/7/scripts/tasks/drush/vset.yml
  12. +0 −2 cmf/drupal/7/scripts/tasks/prepare-environment.yml
  13. +2 −2 cmf/drupal/7/scripts/tasks/super-admin.yml
  14. +1 −1 cmf/drupal/7/scripts/tests.yml
  15. +1 −1 cmf/wordpress/4/scripts/reinstall.yml
  16. +1 −1 cmf/wordpress/4/scripts/tasks/super-admin.yml
  17. +1 −1 cmf/wordpress/4/scripts/tasks/wp-cli/commands.yml
  18. +1 −1 cmf/wordpress/4/scripts/tasks/wp-cli/plugins.yml
  19. +1 −3 scripts/provision.yml
  20. +5 −5 scripts/repository.yml
  21. +0 −1 scripts/roles/ansible-role-apache/tasks/setup.yml
  22. +0 −1 scripts/roles/ansible-role-php/tasks/setup-Debian.yml
  23. +0 −2 scripts/roles/cibox-composer-drush/tasks/main.yml
  24. +0 −4 scripts/roles/cibox-jenkins/tasks/cli.yml
  25. +0 −1 scripts/roles/cibox-jenkins/tasks/dependencies_deb.yml
  26. +0 −2 scripts/roles/cibox-jenkins/tasks/main.yml
  27. +0 −1 scripts/roles/cibox-jenkins/tasks/plugins.yml
  28. +0 −4 scripts/roles/cibox-jenkins/tasks/repo.yml
  29. +0 −2 scripts/roles/cibox-jetty-solr/tasks/main.yml
  30. +0 −3 scripts/roles/cibox-protected-folders/tasks/main.yml
  31. +0 −1 scripts/roles/cibox-ssl-config/defaults/main.yml
  32. +0 −10 scripts/roles/cibox-ssl-config/tasks/main.yml
  33. +0 −117 scripts/roles/cibox-ssl-config/templates/default-ssl.j2
  34. +16 −22 scripts/roles/cibox-swap/tasks/main.yml
4 cibox
@@ -140,4 +140,8 @@ fi

export PYTHONUNBUFFERED=1

# Go to the directory with playbook to set a relative path for tasks.
# https://groups.google.com/forum/#!topic/ansible-project/QqaBvKVKDDQ
cd ${playbook%/*}

time eval "ansible-playbook ${playbook} ${params}"
@@ -1,12 +1,10 @@
---
- name: Creating backup folder for environment
sudo: yes
file:
path: "{{ webroot }}/backup/{{ env }}"
state: directory

- name: Making regular backup
sudo: yes
mysql_db:
name: "{{ item.value }}"
state: dump
@@ -2,7 +2,7 @@
- hosts: localhost
gather_facts: yes
connection: local
sudo: yes
become: yes

vars_files:
- ../config.yml
@@ -2,7 +2,7 @@
- hosts: localhost
gather_facts: no
connection: local
sudo: yes
become: yes

vars_files:
- ../config.yml
@@ -26,7 +26,7 @@

- name: Run security review
shell: "cd ../docroot && drush secrev 2>&1 | grep error | tee -a {{ reports_dir }}/security_review.txt"
environment: env_vars
environment: "{{ env_vars }}"

- name: Create SecurityReview report
shell: 'if [ -s {{ reports_dir }}/security_review.txt ]; then echo "<a href=\"{{ reports_url }}/security_review.txt\" target=\"_blank\">SecurityReview</a>" >> {{ artifacts_file }}; fi'
@@ -1,5 +1,5 @@
---
- name: Execute Drush commands
shell: "cd ../docroot && drush {{ item.key }} {{ item.value }} -y"
environment: env_vars
environment: "{{ env_vars }}"
with_dict: commands
@@ -1,6 +1,6 @@
---
- name: Managing features
shell: "cd ../docroot && drush {{ item.key }} {{ item.value | join(' ') }} -y"
environment: env_vars
environment: "{{ env_vars }}"
when: item.value | length
with_dict: features
@@ -1,6 +1,6 @@
---
- name: Managing modules
shell: "cd ../docroot && drush {{ item.key }} {{ item.value | join(' ') }} -y"
environment: env_vars
environment: "{{ env_vars }}"
when: item.value | length
with_dict: modules
@@ -2,4 +2,4 @@
- name: Rebuild registry
sudo: no
shell: "cd ../docroot && drush rr -y"
environment: env_vars
environment: "{{ env_vars }}"
@@ -1,6 +1,6 @@
---
- name: Installing Drupal
shell: "cd ../docroot && drush -y si {{ profile }} --db-url=mysql://{{ mysql.user }}:{{ mysql.pass }}@{{ mysql.host | default('127.0.0.1') }}:{{ mysql.port | default('3306') }}/{{ databases.default }} --uri={{ site_url }}"
environment: env_vars
environment: "{{ env_vars }}"

- include: ../prepare-environment.yml
@@ -1,4 +1,4 @@
---
- name: Run database updates
shell: "cd ../docroot && drush updb -y"
environment: env_vars
environment: "{{ env_vars }}"
@@ -1,5 +1,5 @@
---
- name: Set Drupal variables
shell: "cd ../docroot && drush vset {{ item.key }} {{ item.value }} -y"
environment: env_vars
environment: "{{ env_vars }}"
with_dict: drupal.variables
@@ -1,6 +1,5 @@
---
- name: Set accesses for directories
sudo: yes
file:
mode: 0777
dest: "{{ item }}"
@@ -13,7 +12,6 @@
- "../docroot/sites/default"

- name: Remove settings.php
sudo: yes
file:
path: ../docroot/sites/default/settings.php
state: absent
@@ -1,8 +1,8 @@
---
- name: Set username for super-admin
shell: 'cd ../docroot && drush sqlc "UPDATE users SET name={{ drupal.user.name }} WHERE uid=1"'
environment: env_vars
environment: "{{ env_vars }}"

- name: Set password for super-admin
shell: 'cd ../docroot && drush upwd {{ drupal.user.name }} --password={{ drupal.user.pass }}'
environment: env_vars
environment: "{{ env_vars }}"
@@ -2,7 +2,7 @@
- hosts: localhost
gather_facts: yes
connection: local
sudo: yes
become: yes

vars_files:
- ../config.yml
@@ -2,7 +2,7 @@
- hosts: localhost
gather_facts: yes
connection: local
sudo: yes
become: yes

vars_files:
- ../config.yml
@@ -1,4 +1,4 @@
---
- name: Set password for super-admin
shell: "cd ../docroot && wp user update 1 --user_login={{ wordpress.user.name }} --user_pass={{ wordpress.user.pass }} --allow-root"
environment: env_vars
environment: "{{ env_vars }}"
@@ -1,5 +1,5 @@
---
- name: Execute WP CLI commands
shell: "cd ../docroot && wp {{ item.key }} {{ item.value }} --allow-root"
environment: env_vars
environment: "{{ env_vars }}"
with_dict: commands
@@ -1,6 +1,6 @@
---
- name: Managing plugins
shell: "cd ../docroot && wp plugin {{ item.key }} {{ item.value | join(' ') }} --activate --allow-root"
environment: env_vars
environment: "{{ env_vars }}"
when: item.value | length
with_dict: plugins
@@ -1,7 +1,7 @@
---
- hosts: all
gather_facts: yes
sudo: yes
become: yes

vars_files:
- ../config.yml
@@ -16,8 +16,6 @@
solr_enabled: true
# Use this secret in your client(Drupal Varnish module) in order to connect to Varnish.
varnish_secret: "14bac2e6-1e34-4770-8078-974373b76c90"
# SSL configuration.
cibox_ssl_enable_host: true
composer_packages:
drush/drush: 7.*

@@ -5,12 +5,12 @@

vars:
# As name of folder inside of "cmf/".
cmf: drupal
cmf: "drupal"
# As name of folder inside of "cmf/<NAME>/"
version: 7.41
version: "7.41"
# Host for cloning repository from.
host: https://github.com
adminer: 4.2.2
host: "https://github.com"
adminer: "4.2.2"

vars_files:
- ../config.yml
@@ -20,7 +20,7 @@

- name: Determine major version of CMF
set_fact:
major: '{{ version | regex_replace("^(\d).*$", "\\1") }}'
major: "{{ version | splitext | first }}"

# Part of namespace on a host (vendor name).
- name: Set vendor name
@@ -20,7 +20,6 @@
with_items: apache_packages

- name: Ensure that necessary ports free and processes stopped
sudo: yes
shell: "kill $(sudo lsof -t -i:{{ item }}) > /dev/null 2>&1"
args:
executable: /bin/bash
@@ -1,6 +1,5 @@
---
- name: Set up php 5.6
sudo: yes
action: apt_repository repo='ppa:ondrej/php5-5.6' state=present
ignore_errors: yes

@@ -1,6 +1,5 @@
---
- name: Install Drush
sudo: yes
shell: "composer global require drush/drush:{{ cibox_composer_drush.version }} --no-interaction --no-ansi"
sudo_user: "{{ cibox_composer_drush.user }}"

@@ -9,7 +8,6 @@
register: user_home

- name: Create symlinks
sudo: yes
file:
src: "{{ user_home.stdout }}/.composer/vendor/{{ item.src }}"
dest: "{{ item.dest }}"
@@ -6,12 +6,10 @@

# Create Jenkins CLI destination directory
- name: Create Jenkins CLI destination directory
sudo: yes
file: path={{ jenkins_dest }} state=directory

# Get Jenkins CLI from localhost
- name: Get Jenkins CLI
sudo: yes
get_url:
url: http://localhost:8080/jnlpJars/jenkins-cli.jar
dest: "{{ jenkins.cli_dest }}"
@@ -23,13 +21,11 @@

# Get latest Jenkins update file
- name: Get Jenkins updates
sudo: yes
get_url: url=http://updates.jenkins-ci.org/update-center.json dest={{ jenkins.updates_dest }} thirsty=yes mode=0440
register: jenkins_updates

# Jenkins Update-center
- name: Update-center Jenkins
sudo: yes
action: "shell cat {{ jenkins.updates_dest }} | sed '1d;$d' | curl -X POST -H 'Accept: application/json' -d @- http://localhost:8080/updateCenter/byId/default/postBack"
when: jenkins_updates.changed
notify: Restart Jenkins
@@ -1,6 +1,5 @@
---
# Install Jenkins dependencies
- name: Install dependencies
sudo: yes
action: "{{ ansible_pkg_mgr }} pkg={{ item }} state=installed"
with_items: jenkins.deb.dependencies
@@ -7,10 +7,8 @@
url: "{{ jenkins_pkg_version }}"
dest: ~/jenkins.deb
mode: 440
sudo: yes

- name: Install Jenkins
sudo: yes
shell: "dpkg -i ~/jenkins.deb"

- include: cli.yml
@@ -1,6 +1,5 @@
---
- name: Install/update plugins
sudo: yes
action: command java -jar {{ jenkins.cli_dest }} -s http://localhost:8080 install-plugin {{ item }}
with_items: plugins
notify: Restart Jenkins
@@ -1,21 +1,17 @@
---
# Provides add-apt-repository
- name: Install python-software-properties
sudo: yes
action: "{{ ansible_pkg_mgr }} pkg=python-software-properties state=installed"

- name: Install python-pycurl
sudo: yes
action: "{{ ansible_pkg_mgr }} pkg=python-pycurl state=installed"

# Add Jenkins repository key
- name: Add jenkins apt-key
sudo: yes
action: apt_key url={{ jenkins.deb.key }} state=present

# Add Jenkins repository
- name: Add Jenkins repository
sudo: yes
action: apt_repository repo='{{ jenkins.deb.repo }}' state=present
ignore_errors: yes

@@ -1,8 +1,6 @@
---
# Stolen here https://www.digitalocean.com/community/tutorials/how-to-install-solr-on-ubuntu-14-04

- name: Install dependencies
sudo: yes
action: "{{ ansible_pkg_mgr }} pkg={{ item }} state=installed"
with_items: jetty_solr_dependencies

@@ -1,6 +1,5 @@
---
- name: Create protected folders
sudo: yes
file:
path: "{{ item }}"
owner: www-data
@@ -9,14 +8,12 @@
with_items: cibox_protected_folders.list

- name: Copy .htaccess to the protected folders
sudo: yes
template:
src: htaccess-protect.j2
dest: "{{ item }}/.htaccess"
with_items: cibox_protected_folders.list

- name: Generate .htpasswd in protected folders
sudo: yes
htpasswd:
path: "{{ item }}/.htpasswd"
name: "{{ cibox_protected_folders.user }}"
@@ -1,3 +1,2 @@
---
cibox_ssl_enable_host: false
cibox_ssl_folder: /etc/apache2/ssl
@@ -1,18 +1,8 @@
---
- name: Assures SSL folder exists
sudo: yes
file:
path: "{{ cibox_ssl_folder }}"
state: directory

- name: Create self-signed SSL cert
sudo: yes
command: openssl req -x509 -nodes -days 365 -newkey rsa:2048 -subj "/C=US" -keyout {{ cibox_ssl_folder }}/apache.key -out {{ cibox_ssl_folder }}/apache.crt

# @TODO should be used apache template and apache role. Currently used only for CI server.
- name: Copy SSL apache vhost file
sudo: yes
template:
src: default-ssl.j2
dest: /etc/apache2/sites-enabled/default-ssl.conf
when: cibox_ssl_enable_host
Oops, something went wrong.

0 comments on commit 0407467

Please sign in to comment.