skip-tags added. Fixed #121

This commit is contained in:
Jack Ivanov 2016-10-28 21:00:11 +03:00
parent 6c66cb03c7
commit d052cb8e77
2 changed files with 15 additions and 5 deletions

12
algo
View file

@ -2,6 +2,8 @@
set -e
SKIP_TAGS="_null"
additional_roles () {
read -p "
Do you want to apply security enhancements?
@ -37,7 +39,7 @@ if [[ "$ssh_tunneling_enabled" =~ ^(y|Y)$ ]]; then ROLES+=" ssh_tunneling"; fi
deploy () {
ansible-playbook deploy.yml -t "${ROLES// /,}" -e "${EXTRA_VARS}"
ansible-playbook deploy.yml -t "${ROLES// /,}" -e "${EXTRA_VARS}" --skip-tags "${SKIP_TAGS// /,}"
}
@ -88,7 +90,7 @@ Enter the number of your desired region:
12) do_region="blr1" ;;
esac
ROLES="digitalocean vpn"
ROLES="digitalocean vpn cloud"
EXTRA_VARS="do_access_token=$do_access_token do_ssh_name=$do_ssh_name do_server_name=$do_server_name do_region=$do_region"
}
@ -145,7 +147,7 @@ Enter the number of your desired region:
12) region="sa-east-1" ;;
esac
ROLES="ec2 vpn"
ROLES="ec2 vpn cloud"
EXTRA_VARS="aws_access_key=$aws_access_key aws_secret_key=$aws_secret_key aws_server_name=$aws_server_name ssh_public_key=$ssh_public_key region=$region"
}
@ -198,7 +200,7 @@ Please choose the number of your zone. Press enter for default (#8) zone.
13) zone="asia-east1-c" ;;
esac
ROLES="gce vpn"
ROLES="gce vpn cloud"
EXTRA_VARS="credentials_file=$credentials_file server_name=$server_name ssh_public_key=$ssh_public_key zone=$zone"
}
@ -218,7 +220,7 @@ Enter the public IP address of your server: (IMPORTANT! This IP is used to verif
ROLES="local vpn"
EXTRA_VARS="server_ip=$server_ip server_user=$server_user IP_subject_alt_name=$IP_subject"
SKIP_TAGS+=" cloud"
}
algo_provisioning () {

View file

@ -12,6 +12,8 @@
args:
executable: /bin/bash
register: reboot_required
tags:
- cloud
- name: Reboot
shell: sleep 2 && shutdown -r now "Ansible updates triggered"
@ -19,16 +21,22 @@
poll: 0
when: reboot_required is defined and reboot_required.stdout == 'required'
ignore_errors: true
tags:
- cloud
- name: Wait for shutdown
local_action: wait_for host={{ inventory_hostname }} port=22 state=stopped timeout=120
when: reboot_required is defined and reboot_required.stdout == 'required'
become: false
tags:
- cloud
- name: Wait until SSH becomes ready...
local_action: wait_for host={{ inventory_hostname }} port=22 state=started timeout=120
when: reboot_required is defined and reboot_required.stdout == 'required'
become: false
tags:
- cloud
- name: Disable MOTD on login and SSHD
replace: dest="{{ item.file }}" regexp="{{ item.regexp }}" replace="{{ item.line }}"