feat: add example of test plugin (for collection)
This commit is contained in:
9
plugins/log-playbook.yml
Normal file
9
plugins/log-playbook.yml
Normal file
@ -0,0 +1,9 @@
|
||||
- name: Exemple log dans un fichier
|
||||
hosts: localhost
|
||||
gather_facts: no
|
||||
tasks:
|
||||
- name: Test de ping
|
||||
ping:
|
||||
- name: Message de test
|
||||
debug:
|
||||
msg: "Ce message sera loggé dans le fichier"
|
8
plugins/playbook-blue.yml
Normal file
8
plugins/playbook-blue.yml
Normal file
@ -0,0 +1,8 @@
|
||||
- name: Test blue
|
||||
hosts: localhost
|
||||
vars:
|
||||
my_color_choice: "#00f"
|
||||
tasks:
|
||||
- name: "Verify {{ my_color_choice }} is a form of blue."
|
||||
assert:
|
||||
that: my_color_choice is blue
|
10
plugins/plugin-lines.yml
Normal file
10
plugins/plugin-lines.yml
Normal file
@ -0,0 +1,10 @@
|
||||
- name: checking out lines and pipes lookup plugins
|
||||
hosts: localhost
|
||||
gather_facts: no
|
||||
tasks:
|
||||
- name: print the first line of any file
|
||||
debug:
|
||||
msg: "{{ item[0] }}"
|
||||
loop:
|
||||
- "{{ query('lines', 'cat /etc/hosts') }}"
|
||||
- "{{ query('lines', 'cat /etc/passwd') }}"
|
17
plugins/test_plugins/blue.py
Normal file
17
plugins/test_plugins/blue.py
Normal file
@ -0,0 +1,17 @@
|
||||
def is_blue(string):
|
||||
blue_values = [
|
||||
'blue',
|
||||
'#0000ff',
|
||||
'#00f',
|
||||
'rgb(0,0,255)',
|
||||
'rgb(0%,0%,100%)',
|
||||
]
|
||||
if string in blue_values:
|
||||
return True
|
||||
else:
|
||||
return False
|
||||
|
||||
class TestModule(object):
|
||||
''' Ansible core blue test '''
|
||||
def tests(self):
|
||||
return {'blue': is_blue}
|
Reference in New Issue
Block a user