Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
serverdensity
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Service Desk
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Ansible
Roles
serverdensity
Commits
0d3689d3
Commit
0d3689d3
authored
9 years ago
by
jurgenhaas
Browse files
Options
Downloads
Patches
Plain Diff
Allow to exclude roles from plays with --exclude-roles command line parameter
parent
503cf51e
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
tasks/main.yml
+2
-63
2 additions, 63 deletions
tasks/main.yml
tasks/serverdensity.yml
+66
-0
66 additions, 0 deletions
tasks/serverdensity.yml
with
68 additions
and
63 deletions
tasks/main.yml
+
2
−
63
View file @
0d3689d3
---
# file: roles/serverdensity/tasks/main.yml
-
include
:
uninstallv1.yml
when
:
sd_uninstallv1
-
name
:
"
ServerDensity
|
Init
SD
plugin"
local_action
:
serverdensity
api_token={{ sd_api_token }}
cleanup={{ sd_alert_cleanup }}
force={{ sd_force_update }}
cache={{ sd_api_cache_file }}
when
:
sd_update_remote
-
name
:
"
ServerDensity
|
Install
Public
Repo
Key"
apt_key
:
url={{ sd_repo_public_key_uri }}
state=present
-
name
:
"
ServerDensity
|
Add
ServerDensity
Repository
To
Apt"
copy
:
content='deb http://archive.serverdensity.com/ubuntu/ all main'
dest=/etc/apt/sources.list.d/sd-agent.list
mode=644
-
name
:
"
ServerDensity
|
Install
The
Agent"
apt
:
pkg=sd-agent
state=installed
update_cache=yes
notify
:
"
ServerDensity
|
Restart
Agent"
-
name
:
"
ServerDensity
|
Create
Plugins
Directory"
file
:
dest={{ sd_agent_plugins_dir }}
state=directory
mode=755
-
name
:
"
ServerDensity
|
Copy
Plugins"
copy
:
src={{ sd_plugins_files_dir }}/{{ item }}
dest={{ sd_agent_plugins_dir }}/{{ item }}
with_items
:
'
{{
sd_plugins
}}'
when
:
sd_plugins|length >
0
notify
:
"
ServerDensity
|
Restart
Agent"
-
name
:
"
ServerDensity
|
Configure
The
Agent"
template
:
src={{ item }}
dest=/etc/sd-agent/{{ item }}
owner=root
group=root
mode=0644
with_items
:
-
'
config.cfg'
-
'
plugins.cfg'
#- 'supervisor.conf'
when
:
sd_agent_key != ''
notify
:
"
ServerDensity
|
Restart
Agent"
-
include
:
apache.yml
when
:
sd_groups.apache != 'none' and inventory_hostname in groups[sd_groups.apache]
-
include
:
mysql.yml
when
:
sd_groups.mysql != 'none' and inventory_hostname in groups[sd_groups.mysql]
-
include
:
serverdensity.yml
when
:
'
"serverdensity"
not
in
excluded_roles'
This diff is collapsed.
Click to expand it.
tasks/serverdensity.yml
0 → 100644
+
66
−
0
View file @
0d3689d3
---
# file: roles/serverdensity/tasks/serverdensity.yml
-
include
:
uninstallv1.yml
when
:
sd_uninstallv1
-
name
:
"
ServerDensity
|
Init
SD
plugin"
local_action
:
serverdensity
api_token={{ sd_api_token }}
cleanup={{ sd_alert_cleanup }}
force={{ sd_force_update }}
cache={{ sd_api_cache_file }}
when
:
sd_update_remote
-
name
:
"
ServerDensity
|
Install
Public
Repo
Key"
apt_key
:
url={{ sd_repo_public_key_uri }}
state=present
-
name
:
"
ServerDensity
|
Add
ServerDensity
Repository
To
Apt"
copy
:
content='deb http://archive.serverdensity.com/ubuntu/ all main'
dest=/etc/apt/sources.list.d/sd-agent.list
mode=644
-
name
:
"
ServerDensity
|
Install
The
Agent"
apt
:
pkg=sd-agent
state=installed
update_cache=yes
notify
:
"
ServerDensity
|
Restart
Agent"
-
name
:
"
ServerDensity
|
Create
Plugins
Directory"
file
:
dest={{ sd_agent_plugins_dir }}
state=directory
mode=755
-
name
:
"
ServerDensity
|
Copy
Plugins"
copy
:
src={{ sd_plugins_files_dir }}/{{ item }}
dest={{ sd_agent_plugins_dir }}/{{ item }}
with_items
:
'
{{
sd_plugins
}}'
when
:
sd_plugins|length >
0
notify
:
"
ServerDensity
|
Restart
Agent"
-
name
:
"
ServerDensity
|
Configure
The
Agent"
template
:
src={{ item }}
dest=/etc/sd-agent/{{ item }}
owner=root
group=root
mode=0644
with_items
:
-
'
config.cfg'
-
'
plugins.cfg'
#- 'supervisor.conf'
when
:
sd_agent_key != ''
notify
:
"
ServerDensity
|
Restart
Agent"
-
include
:
apache.yml
when
:
sd_groups.apache != 'none' and inventory_hostname in groups[sd_groups.apache]
-
include
:
mysql.yml
when
:
sd_groups.mysql != 'none' and inventory_hostname in groups[sd_groups.mysql]
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment