diff --git a/roles/openvpn/templates/iiab-support b/iiab-support old mode 100644 new mode 100755 similarity index 96% rename from roles/openvpn/templates/iiab-support rename to iiab-support index 87172339a..f71fca85e --- a/roles/openvpn/templates/iiab-support +++ b/iiab-support @@ -1,4 +1,6 @@ #!/bin/bash +PLAYBOOK="install-support.yml" +INVENTORY="ansible_hosts" # openvpn_handle is stored in 2 files on disk, one slightly stripped down (from # the other) due to Ansible. So we emulate Ansible's behavior, when reading from @@ -53,7 +55,9 @@ else echo "openvpn_install: True" >> /etc/iiab/local_vars.yml fi cd /opt/iiab/iiab - ./runrole 1-prep + CWD=`pwd` + export ANSIBLE_LOG_PATH="$CWD/iiab-install.log" + ansible-playbook -i $INVENTORY $PLAYBOOK --connection=local echo fi diff --git a/install-support b/install-support deleted file mode 100755 index aad78fe93..000000000 --- a/install-support +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/bash - -echo -e "\n\n\e[41m DEPRECATED PLEASE RUN 'iiab-support' INSTEAD \e[0m\n\n" - -read -p "Continue? [y/N] " ans -if [ "$ans" != "y" ]; then - echo - exit -fi - -PLAYBOOK="install-support.yml" -INVENTORY="ansible_hosts" -CWD=`pwd` - -export ANSIBLE_LOG_PATH="$CWD/iiab-install.log" - -if [ ! -f $PLAYBOOK ]; then - echo -e "\nEXITING: $PLAYBOOK not found.\n" - echo -e "Please run this command from /opt/iiab/iiab (top of git repo).\n" - exit 1 -fi - -sed -i -e "s/^openvpn_install:.*/openvpn_install: True/" /etc/iiab/local_vars.yml -sed -i -e "s/^openvpn_enabled:.*/openvpn_enabled: True/" /etc/iiab/local_vars.yml - -ansible-playbook -i $INVENTORY $PLAYBOOK --connection=local diff --git a/install-support.yml b/install-support.yml index b7a9faf75..e47229004 100644 --- a/install-support.yml +++ b/install-support.yml @@ -8,7 +8,6 @@ roles: - { role: 0-init, tags: ['0-init'] } - #- { role: 1-prep, tags: ['1-prep', 'platform', 'base'] } - - { role: 1-prep, tags: ['1-prep'] } - #- { role: openvpn, tags: ['openvpn'] } # FASTER ALTERNATIVE THAN 1-prep (if 1-prep was already run!) - # BETTER YET, SEE: /usr/bin/iiab-support for a much friendlier UX, that only runs 1-prep when necessary. + - { role: sshd, tags: ['sshd'] } + - { role: iiab-admin, tags: ['iiab-admin'] } + - { role: openvpn, tags: ['openvpn'] } diff --git a/roles/openvpn/tasks/main.yml b/roles/openvpn/tasks/main.yml index 178676615..5bb18748c 100644 --- a/roles/openvpn/tasks/main.yml +++ b/roles/openvpn/tasks/main.yml @@ -82,7 +82,6 @@ - { src: 'silence', dest: '/etc/openvpn/scripts/silence', mode: '0755' } - { src: 'xscenet.conf.j2', dest: '/etc/openvpn/xscenet.conf', mode: '0644' } - { src: 'openvpn_handle.j2', dest: '/etc/iiab/openvpn_handle', mode: '0644' } - - { src: 'iiab-support', dest: '/usr/bin/iiab-support', mode: '0755' } - { src: 'iiab-remote-on.j2', dest: '/usr/bin/iiab-remote-on', mode: '0755' } - { src: 'iiab-remote-off', dest: '/usr/bin/iiab-remote-off', mode: '0755' } # Comment out in future? Not recommended as of August 2018: @@ -96,15 +95,21 @@ # Obsolete & unused for ~2 years as of August 2018: #- { src: 'iiab-vpn.j2', dest: '/usr/bin/iiab-vpn', mode: '0755' } +- name: Create iiab-support (symlink to iiab-support in git) + file: + src: "{{ iiab_dir }}/iiab-support" + path: /usr/bin/iiab-support + state: link + - name: Create iiab-support-on (symlink to iiab-support for now) file: - src: /usr/bin/iiab-support + src: "{{ iiab_dir }}/iiab-support" path: /usr/bin/iiab-support-on state: link - name: Create iiab-support-off (symlink to iiab-remote-off for now) file: - src: /usr/bin/iiab-remote-off + src: "{{ iiab_dir }}/iiab-remote-off" path: /usr/bin/iiab-support-off state: link