Skip to content

Commit f2d1503

Browse files
committed
Rename environment variables for lookup modules.
1 parent 1a693c8 commit f2d1503

File tree

14 files changed

+190
-190
lines changed

14 files changed

+190
-190
lines changed

plugins/lookup/README.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ This way, they do not need to be provided at task level.
66

77
### Method 1: Environment variables
88
```bash
9-
export ANSIBLE_LOOKUP_CHECKMK_SERVER_URL="https://myserver"
10-
export ANSIBLE_LOOKUP_CHECKMK_SITE=mysite
11-
export ANSIBLE_LOOKUP_CHECKMK_AUTOMATION_USER=automation
12-
export ANSIBLE_LOOKUP_CHECKMK_AUTOMATION_SECRET=mysecret
13-
export ANSIBLE_LOOKUP_CHECKMK_VALIDATE_CERTS=False
9+
export CHECKMK_VAR_SERVER_URL="https://myserver"
10+
export CHECKMK_VAR_SITE=mysite
11+
export CHECKMK_VAR_AUTOMATION_USER=automation
12+
export CHECKMK_VAR_AUTOMATION_SECRET=mysecret
13+
export CHECKMK_VAR_VALIDATE_CERTS=False
1414
```
1515

1616
### Method 2: In `ansible.cfg`
@@ -30,11 +30,11 @@ validate_certs = False
3030
hosts: localhost
3131
gather_facts: false
3232
vars:
33-
ansible_lookup_checkmk_server_url: "https://myserver"
34-
ansible_lookup_checkmk_site: "mysite"
35-
ansible_lookup_checkmk_automation_user: "myuser"
36-
ansible_lookup_checkmk_automation_secret: "mysecret"
37-
ansible_lookup_checkmk_validate_certs: false
33+
checkmk_var_server_url: "https://myserver"
34+
checkmk_var_site: "mysite"
35+
checkmk_var_automation_user: "myuser"
36+
checkmk_var_automation_secret: "mysecret"
37+
checkmk_var_validate_certs: false
3838

3939
tasks:
4040
- name: Get the attributes of myhost

plugins/lookup/bakery.py

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@
2121
description: URL of the Checkmk server
2222
required: True
2323
vars:
24-
- name: ansible_lookup_checkmk_server_url
24+
- name: checkmk_var_server_url
2525
env:
26-
- name: ANSIBLE_LOOKUP_CHECKMK_SERVER_URL
26+
- name: CHECKMK_VAR_SERVER_URL
2727
ini:
2828
- section: checkmk_lookup
2929
key: server_url
@@ -32,9 +32,9 @@
3232
description: Site name.
3333
required: True
3434
vars:
35-
- name: ansible_lookup_checkmk_site
35+
- name: checkmk_var_site
3636
env:
37-
- name: ANSIBLE_LOOKUP_CHECKMK_SITE
37+
- name: CHECKMK_VAR_SITE
3838
ini:
3939
- section: checkmk_lookup
4040
key: site
@@ -43,9 +43,9 @@
4343
description: Automation user for the REST API access.
4444
required: True
4545
vars:
46-
- name: ansible_lookup_checkmk_automation_user
46+
- name: checkmk_var_automation_user
4747
env:
48-
- name: ANSIBLE_LOOKUP_CHECKMK_AUTOMATION_USER
48+
- name: CHECKMK_VAR_AUTOMATION_USER
4949
ini:
5050
- section: checkmk_lookup
5151
key: automation_user
@@ -54,9 +54,9 @@
5454
description: Automation secret for the REST API access.
5555
required: True
5656
vars:
57-
- name: ansible_lookup_checkmk_automation_secret
57+
- name: checkmk_var_automation_secret
5858
env:
59-
- name: ANSIBLE_LOOKUP_CHECKMK_AUTOMATION_SECRET
59+
- name: CHECKMK_VAR_AUTOMATION_SECRET
6060
ini:
6161
- section: checkmk_lookup
6262
key: automation_secret
@@ -67,9 +67,9 @@
6767
required: False
6868
default: True
6969
vars:
70-
- name: ansible_lookup_checkmk_validate_certs
70+
- name: checkmk_var_validate_certs
7171
env:
72-
- name: ANSIBLE_LOOKUP_CHECKMK_VALIDATE_CERTS
72+
- name: CHECKMK_VAR_VALIDATE_CERTS
7373
ini:
7474
- section: checkmk_lookup
7575
key: validate_certs
@@ -100,11 +100,11 @@
100100
ansible.builtin.debug:
101101
msg: "Bakery status is {{ bakery }}"
102102
vars:
103-
ansible_lookup_checkmk_server_url: "http://myserver/"
104-
ansible_lookup_checkmk_site: "mysite"
105-
ansible_lookup_checkmk_automation_user: "myuser"
106-
ansible_lookup_checkmk_automation_secret: "mysecret"
107-
ansible_lookup_checkmk_validate_certs: false
103+
checkmk_var_server_url: "http://myserver/"
104+
checkmk_var_site: "mysite"
105+
checkmk_var_automation_user: "myuser"
106+
checkmk_var_automation_secret: "mysecret"
107+
checkmk_var_validate_certs: false
108108
bakery: "{{ lookup('checkmk.general.bakery') }}"
109109
"""
110110

plugins/lookup/folder.py

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@
2525
description: URL of the Checkmk server
2626
required: True
2727
vars:
28-
- name: ansible_lookup_checkmk_server_url
28+
- name: checkmk_var_server_url
2929
env:
30-
- name: ANSIBLE_LOOKUP_CHECKMK_SERVER_URL
30+
- name: CHECKMK_VAR_SERVER_URL
3131
ini:
3232
- section: checkmk_lookup
3333
key: server_url
@@ -36,9 +36,9 @@
3636
description: Site name.
3737
required: True
3838
vars:
39-
- name: ansible_lookup_checkmk_site
39+
- name: checkmk_var_site
4040
env:
41-
- name: ANSIBLE_LOOKUP_CHECKMK_SITE
41+
- name: CHECKMK_VAR_SITE
4242
ini:
4343
- section: checkmk_lookup
4444
key: site
@@ -47,9 +47,9 @@
4747
description: Automation user for the REST API access.
4848
required: True
4949
vars:
50-
- name: ansible_lookup_checkmk_automation_user
50+
- name: checkmk_var_automation_user
5151
env:
52-
- name: ANSIBLE_LOOKUP_CHECKMK_AUTOMATION_USER
52+
- name: CHECKMK_VAR_AUTOMATION_USER
5353
ini:
5454
- section: checkmk_lookup
5555
key: automation_user
@@ -58,9 +58,9 @@
5858
description: Automation secret for the REST API access.
5959
required: True
6060
vars:
61-
- name: ansible_lookup_checkmk_automation_secret
61+
- name: checkmk_var_automation_secret
6262
env:
63-
- name: ANSIBLE_LOOKUP_CHECKMK_AUTOMATION_SECRET
63+
- name: CHECKMK_VAR_AUTOMATION_SECRET
6464
ini:
6565
- section: checkmk_lookup
6666
key: automation_secret
@@ -71,9 +71,9 @@
7171
required: False
7272
default: True
7373
vars:
74-
- name: ansible_lookup_checkmk_validate_certs
74+
- name: checkmk_var_validate_certs
7575
env:
76-
- name: ANSIBLE_LOOKUP_CHECKMK_VALIDATE_CERTS
76+
- name: CHECKMK_VAR_VALIDATE_CERTS
7777
ini:
7878
- section: checkmk_lookup
7979
key: validate_certs
@@ -106,11 +106,11 @@
106106
ansible.builtin.debug:
107107
msg: "Extended attributes of folder /network: {{ attributes.extensions }}"
108108
vars:
109-
ansible_lookup_checkmk_server_url: "http://myserver/"
110-
ansible_lookup_checkmk_site: "mysite"
111-
ansible_lookup_checkmk_automation_user: "myuser"
112-
ansible_lookup_checkmk_automation_secret: "mysecret"
113-
ansible_lookup_checkmk_validate_certs: false
109+
checkmk_var_server_url: "http://myserver/"
110+
checkmk_var_site: "mysite"
111+
checkmk_var_automation_user: "myuser"
112+
checkmk_var_automation_secret: "mysecret"
113+
checkmk_var_validate_certs: false
114114
attributes: "{{ lookup('checkmk.general.folder', '~tests') }}"
115115
"""
116116

plugins/lookup/folders.py

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@
2626
description: URL of the Checkmk server
2727
required: True
2828
vars:
29-
- name: ansible_lookup_checkmk_server_url
29+
- name: checkmk_var_server_url
3030
env:
31-
- name: ANSIBLE_LOOKUP_CHECKMK_SERVER_URL
31+
- name: CHECKMK_VAR_SERVER_URL
3232
ini:
3333
- section: checkmk_lookup
3434
key: server_url
@@ -37,9 +37,9 @@
3737
description: Site name.
3838
required: True
3939
vars:
40-
- name: ansible_lookup_checkmk_site
40+
- name: checkmk_var_site
4141
env:
42-
- name: ANSIBLE_LOOKUP_CHECKMK_SITE
42+
- name: CHECKMK_VAR_SITE
4343
ini:
4444
- section: checkmk_lookup
4545
key: site
@@ -48,9 +48,9 @@
4848
description: Automation user for the REST API access.
4949
required: True
5050
vars:
51-
- name: ansible_lookup_checkmk_automation_user
51+
- name: checkmk_var_automation_user
5252
env:
53-
- name: ANSIBLE_LOOKUP_CHECKMK_AUTOMATION_USER
53+
- name: CHECKMK_VAR_AUTOMATION_USER
5454
ini:
5555
- section: checkmk_lookup
5656
key: automation_user
@@ -59,9 +59,9 @@
5959
description: Automation secret for the REST API access.
6060
required: True
6161
vars:
62-
- name: ansible_lookup_checkmk_automation_secret
62+
- name: checkmk_var_automation_secret
6363
env:
64-
- name: ANSIBLE_LOOKUP_CHECKMK_AUTOMATION_SECRET
64+
- name: CHECKMK_VAR_AUTOMATION_SECRET
6565
ini:
6666
- section: checkmk_lookup
6767
key: automation_secret
@@ -72,9 +72,9 @@
7272
required: False
7373
default: True
7474
vars:
75-
- name: ansible_lookup_checkmk_validate_certs
75+
- name: checkmk_var_validate_certs
7676
env:
77-
- name: ANSIBLE_LOOKUP_CHECKMK_VALIDATE_CERTS
77+
- name: CHECKMK_VAR_VALIDATE_CERTS
7878
ini:
7979
- section: checkmk_lookup
8080
key: validate_certs
@@ -143,11 +143,11 @@
143143
ansible.builtin.debug:
144144
msg: "Folder tree: {{ item.id }}"
145145
vars:
146-
ansible_lookup_checkmk_server_url: "http://myserver/"
147-
ansible_lookup_checkmk_site: "mysite"
148-
ansible_lookup_checkmk_automation_user: "myuser"
149-
ansible_lookup_checkmk_automation_secret: "mysecret"
150-
ansible_lookup_checkmk_validate_certs: false
146+
checkmk_var_server_url: "http://myserver/"
147+
checkmk_var_site: "mysite"
148+
checkmk_var_automation_user: "myuser"
149+
checkmk_var_automation_secret: "mysecret"
150+
checkmk_var_validate_certs: false
151151
loop: "{{
152152
lookup('checkmk.general.folders',
153153
'~',

plugins/lookup/host.py

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@
2525
description: URL of the Checkmk server
2626
required: True
2727
vars:
28-
- name: ansible_lookup_checkmk_server_url
28+
- name: checkmk_var_server_url
2929
env:
30-
- name: ANSIBLE_LOOKUP_CHECKMK_SERVER_URL
30+
- name: CHECKMK_VAR_SERVER_URL
3131
ini:
3232
- section: checkmk_lookup
3333
key: server_url
@@ -36,9 +36,9 @@
3636
description: Site name.
3737
required: True
3838
vars:
39-
- name: ansible_lookup_checkmk_site
39+
- name: checkmk_var_site
4040
env:
41-
- name: ANSIBLE_LOOKUP_CHECKMK_SITE
41+
- name: CHECKMK_VAR_SITE
4242
ini:
4343
- section: checkmk_lookup
4444
key: site
@@ -47,9 +47,9 @@
4747
description: Automation user for the REST API access.
4848
required: True
4949
vars:
50-
- name: ansible_lookup_checkmk_automation_user
50+
- name: checkmk_var_automation_user
5151
env:
52-
- name: ANSIBLE_LOOKUP_CHECKMK_AUTOMATION_USER
52+
- name: CHECKMK_VAR_AUTOMATION_USER
5353
ini:
5454
- section: checkmk_lookup
5555
key: automation_user
@@ -58,9 +58,9 @@
5858
description: Automation secret for the REST API access.
5959
required: True
6060
vars:
61-
- name: ansible_lookup_checkmk_automation_secret
61+
- name: checkmk_var_automation_secret
6262
env:
63-
- name: ANSIBLE_LOOKUP_CHECKMK_AUTOMATION_SECRET
63+
- name: CHECKMK_VAR_AUTOMATION_SECRET
6464
ini:
6565
- section: checkmk_lookup
6666
key: automation_secret
@@ -71,9 +71,9 @@
7171
required: False
7272
default: True
7373
vars:
74-
- name: ansible_lookup_checkmk_validate_certs
74+
- name: checkmk_var_validate_certs
7575
env:
76-
- name: ANSIBLE_LOOKUP_CHECKMK_VALIDATE_CERTS
76+
- name: CHECKMK_VAR_VALIDATE_CERTS
7777
ini:
7878
- section: checkmk_lookup
7979
key: validate_certs
@@ -114,11 +114,11 @@
114114
ansible.builtin.debug:
115115
msg: "Attributes of host example: {{ attributes }}"
116116
vars:
117-
ansible_lookup_checkmk_server_url: "http://myserver/"
118-
ansible_lookup_checkmk_site: "mysite"
119-
ansible_lookup_checkmk_automation_user: "myuser"
120-
ansible_lookup_checkmk_automation_secret: "mysecret"
121-
ansible_lookup_checkmk_validate_certs: false
117+
checkmk_var_server_url: "http://myserver/"
118+
checkmk_var_site: "mysite"
119+
checkmk_var_automation_user: "myuser"
120+
checkmk_var_automation_secret: "mysecret"
121+
checkmk_var_validate_certs: false
122122
attributes: "{{ lookup('checkmk.general.host', 'example.com', effective_attributes=True) }}"
123123
"""
124124

0 commit comments

Comments
 (0)