add ansible "sayhi"
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
surtur 2021-08-09 23:16:51 +02:00
parent d908339cd0
commit 66bc8e2256
Signed by: wanderer
GPG Key ID: 19CE1EC1D9E0486D
9 changed files with 66 additions and 1 deletions

14
.ansible/ansible.cfg Normal file

@ -0,0 +1,14 @@
[defaults]
inventory = inventory
remote_tmp = $HOME/.ansible/tmp
remote_user = root
nocows = 1
roles_path = roles
retry_files_enabled = False
max_diff_size = 250000
[ssh_connection]
pipelining = True
scp_if_ssh = True
retries = 7

3
.ansible/inventory Normal file

@ -0,0 +1,3 @@
[testtgt]
dotya.ml

@ -0,0 +1 @@
---

@ -0,0 +1,7 @@
---
- hosts: testtgt
become: true
become_user: root
become_method: sudo
roles:
- { role: sayhi }

@ -0,0 +1,9 @@
# sayhi
this role is used to say hi (create test files)
## License
GPLv3
## Author
wanderer@git.dotya.ml

@ -0,0 +1 @@
---

@ -0,0 +1,9 @@
---
- name: verify files are not present
file:
path: "/tmp/{{item}}"
state: absent
mode: 0755
with_items:
- "{{additional_var}}"
- "{{another_var}}"

@ -0,0 +1 @@
---

@ -33,4 +33,24 @@ steps:
- echo $PATH - echo $PATH
- echo $SHELL - echo $SHELL
- /usr/local/bin/giteaupdater - /usr/local/bin/giteaupdater
- ansible --version
- name: ansible - sayhi
image: plugins/ansible:3.0.0
environment:
ANSIBLE_CONFIG: .ansible/ansible.cfg
DEFAULT_REMOTE_USER:
from_secret: username
settings:
playbook: .ansible/playbooks/playbook.yml
inventory: .ansible/inventory
extra_vars:
'additional_var=footestpls,another_var=bartest'
ssh_extra_args: "'-o StrictHostKeyChecking=no'"
private_key:
from_secret: ssh-key
verbose: 2
user:
from_secret: username
when:
event:
- push