Skip to content

Commit

Permalink
Adjust SSH key lookup to site specific local facts
Browse files Browse the repository at this point in the history
  • Loading branch information
ganto committed Jul 25, 2016
1 parent 665e6b1 commit 1e7b0af
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,23 @@ checkmk_agent__ferm__dependent_rules:

# .. )))

# .. Monitoring site integration (((
#
# -------------------------------
# Monitoring site integration
# -------------------------------

# .. envvar:: checkmk_agent__site_name
#
# Define Check_MK monitoring site name where agent is registered.
checkmk_agent__site: '{{ hostvars[groups["debops_service_checkmk_server"][0]].ansible_local.checkmk_server[0]|d("debops")
if ("debops_service_checkmk_server" in groups) and
(groups["debops_service_checkmk_server"] | length > 0) and
(hostvars[groups["debops_service_checkmk_server"][0]]|d({}))
else "debops" }}'

# .. )))

# .. Agent xinetd options (((
#
# ------------------------
Expand Down Expand Up @@ -114,7 +131,7 @@ checkmk_agent__user_home: '/var/lib/nagios'
# .. envvar:: checkmk_agent__user_key
#
# SSH Public key for logging in with SSH user.
checkmk_agent__user_key: '{{ hostvars[groups["debops_service_checkmk_server"][0]].ansible_local.checkmk_server.ssh_publickey|d("")
checkmk_agent__user_key: '{{ hostvars[groups["debops_service_checkmk_server"][0]].ansible_local.checkmk_server[checkmk_agent__site].ssh_public_key|d("")
if ("debops_service_checkmk_server" in groups) and
(groups["debops_service_checkmk_server"] | length > 0) and
(hostvars[groups["debops_service_checkmk_server"][0]]|d({}))
Expand Down

0 comments on commit 1e7b0af

Please sign in to comment.