Merge branch 'unstable' into stable

This commit is contained in:
Jérémy Lecour 2017-11-21 16:58:49 +01:00 committed by Jérémy Lecour
commit fbd4e741a0
4 changed files with 21 additions and 17 deletions

View file

@ -1,20 +1,22 @@
--- ---
- name: Create default security group - name: Create default security group
ec2_group: ec2_group:
name: "{{ec2_security_group.name}}" name: "{{ ec2_security_group.name }}"
state: present state: present
aws_access_key: "{{aws_access_key}}" aws_access_key: "{{ aws_access_key }}"
aws_secret_key: "{{aws_secret_key}}" aws_secret_key: "{{ aws_secret_key }}"
region: "{{aws_region}}" region: "{{ aws_region }}"
description: "{{ec2_security_group.description}}" description: "{{ ec2_security_group.description }}"
rules: "{{ec2_security_group.rules}}" rules: "{{ ec2_security_group.rules }}"
rules_egress: "{{ ec2_security_group.rules_egress }}"
- name: Create key pair - name: Create key pair
ec2_key: ec2_key:
name: "{{ec2_keyname}}" name: "{{ ec2_keyname }}"
state: present state: present
aws_access_key: "{{aws_access_key}}" aws_access_key: "{{ aws_access_key }}"
aws_secret_key: "{{aws_secret_key}}" aws_secret_key: "{{ aws_secret_key }}"
region: "{{aws_region}}" region: "{{ aws_region }}"
key_material: "{{item}}" key_material: "{{ item }}"
with_file: "{{ssh_pubkey_file}}" with_file: "{{ ssh_pubkey_file }}"

View file

@ -1,6 +1,7 @@
--- ---
- fail: - name: "Compatibility check"
fail:
msg: only compatible with Debian >= 8 msg: only compatible with Debian >= 8
when: when:
- ansible_distribution != "Debian" or ansible_distribution_major_version | version_compare('8', '<') - ansible_distribution != "Debian" or ansible_distribution_major_version | version_compare('8', '<')

View file

@ -50,10 +50,10 @@ sed_cert_path_for_apache() {
local search="^SSLCertificateFile.*$" local search="^SSLCertificateFile.*$"
local replace="SSLCertificateFile ${cert_path}" local replace="SSLCertificateFile ${cert_path}"
if ! $(grep -qE "${search}" "${vhost_full_path}"); then if grep -qE "${search}" "${vhost_full_path}"; then
[ -w "${vhost_full_path}" ] || error "File ${vhost_full_path} is not writable" [ -w "${vhost_full_path}" ] || error "File ${vhost_full_path} is not writable"
sed -i "s~^${search}~${replace}~" "${vhost_full_path}" sed -i "s~${search}~${replace}~" "${vhost_full_path}"
debug "Config in ${vhost_full_path} has been updated" debug "Config in ${vhost_full_path} has been updated"
$(command -v apache2ctl) -t $(command -v apache2ctl) -t
fi fi
@ -68,7 +68,7 @@ sed_cert_path_for_nginx() {
local search="^ssl_certificate[^_].*$" local search="^ssl_certificate[^_].*$"
local replace="ssl_certificate ${cert_path};" local replace="ssl_certificate ${cert_path};"
if ! $(grep -qE "${search}" "${vhost_full_path}"); then if grep -qE "${search}" "${vhost_full_path}"; then
[ -w "${vhost_full_path}" ] || error "File ${vhost_full_path} is not writable" [ -w "${vhost_full_path}" ] || error "File ${vhost_full_path} is not writable"
sed -i "s~${search}~${replace}~" "${vhost_full_path}" sed -i "s~${search}~${replace}~" "${vhost_full_path}"

View file

@ -1,6 +1,7 @@
--- ---
- fail: - name: "Compatibility check"
fail:
msg: only compatible with Debian >= 8 msg: only compatible with Debian >= 8
when: when:
- ansible_distribution != "Debian" or ansible_distribution_major_version | version_compare('8', '<') - ansible_distribution != "Debian" or ansible_distribution_major_version | version_compare('8', '<')