Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ansible-roles
Okmeter
Commits
62a7b9ea
Commit
62a7b9ea
authored
2 years ago
by
AysinIV
Browse files
Options
Download
Email Patches
Plain Diff
Okmeter 1.0.0
parents
main
1.0.0
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
defaults/main.yml
+3
-0
defaults/main.yml
tasks/main.yml
+40
-0
tasks/main.yml
with
43 additions
and
0 deletions
+43
-0
defaults/main.yml
0 → 100644
View file @
62a7b9ea
---
okmeter_password
:
1111
\ No newline at end of file
This diff is collapsed.
Click to expand it.
tasks/main.yml
0 → 100644
View file @
62a7b9ea
---
-
name
:
okmeter agent installed
become
:
yes
shell
:
"
wget
-O
-
'https://okmeter.flant.com/agent/install.sh?t=7207e04d-756d-4382-b2dd-c2fa8a9e22c4&u=38f-6321c480'
|
sh
-s
-"
args
:
creates
:
/usr/local/okagent/supervisor
-
name
:
Create role in DB
postgresql_query
:
query
:
"
CREATE
ROLE
okagent
WITH
LOGIN
PASSWORD
'{{
okmeter_password
}}'"
become
:
yes
become_user
:
postgres
-
name
:
Create schema in DB
postgresql_query
:
query
:
"
CREATE
SCHEMA
okmeter"
become
:
yes
become_user
:
postgres
-
name
:
Grant DB schema to role okagent
postgresql_query
:
query
:
"
GRANT
USAGE
ON
SCHEMA
okmeter
TO
okagent"
become
:
yes
become_user
:
postgres
-
name
:
Create okmeter function
postgresql_query
:
query
:
"
CREATE
OR
REPLACE
FUNCTION
okmeter.pg_stats(text)
RETURNS
SETOF
RECORD
AS
$$
DECLARE
r
record;
BEGIN
FOR
r
IN
EXECUTE
'SELECT
r
FROM
pg_'
||
$1
||
'
r'
LOOP
RETURN
NEXT
r;
END
loop;
RETURN;
END
$$
LANGUAGE
plpgsql
SECURITY
DEFINER;"
become
:
yes
become_user
:
postgres
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Projects
Groups
Snippets
Help