Created
September 10, 2014 11:35
-
-
Save infowolfe/63f510407c6bbc2dfbf1 to your computer and use it in GitHub Desktop.
serverdensity agent role
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
# tasks file for infowolfe.sd-agent | |
- apt: name=python-httplib2 state=present | |
- name: add SD repo key | |
apt_key: url=https://www.serverdensity.com/downloads/boxedice-public.key state=present | |
- name: add sd-agent repo | |
apt_repository: repo="deb http://www.serverdensity.com/downloads/linux/deb all main" state=present update_cache=yes | |
- name: install sd-agent | |
apt: pkg=sd-agent state=installed | |
notify: restart sd-agent | |
- set_fact: uri_post="group={{ sd_group |default(omit) }}&name={{ sd_name |default(ansible_hostname) }}" | |
when: sd_group is defined | |
- set_fact: uri_post="name={{ sd_name |default(ansible_hostname) }}" | |
when: sd_group is not defined | |
- debug: msg="{{ uri_post }}" | |
#- name: acquire agent token | |
# uri: url="https://api.serverdensity.io/inventory/devices/?token={{ sd_api_token }}" | |
# HEADER_Content-Type="application/x-www-form-urlencoded" | |
# method=POST body="{{ uri_post_group }}{{ uri_post_name }}" | |
# status_code=200 | |
# return_content=yes | |
- uri: url="http://zed.in.oasis/file_lookup.json" return_content=yes | |
register: curl_agent_key | |
- set_fact: sd_agent_key="{{ curl_agent_key.json.agentKey }}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment