playbook-base/jumpcloud.yaml

23 lines
766 B
YAML

- hosts: all
sudo: yes
tasks:
- name: Install curl package (Debian based)
action: apt pkg='curl' state=installed
when: "'$ansible_pkg_mgr' == 'apt'"
- name: Install ntpdate package (Debian based)
action: apt pkg='ntpdate' state=installed
when: "'$ansible_pkg_mgr' == 'apt'"
- name: Check if JumpCloud is already installed
shell: "[ -d /opt/jc ] && echo 'Found' || echo ''"
register: jc_installed
- name: Update time
shell: "ntpdate -u pool.ntp.org"
when: "not jc_installed.stdout"
- name: Install JumpCloud
shell: "curl --header 'x-connect-key: 29f6127fec609bfa862f3d0b78db5fc9c0e620b4' https://kickstart.jumpcloud.com/Kickstart | sudo bash"
when: "not jc_installed.stdout"