-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmyplaybooks.yaml
59 lines (42 loc) · 1.22 KB
/
myplaybooks.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
---
# Configure channels here
- name: Register git version that is installed on system
shell: git --version | sed 's/git\ version\ //g'
register: git_version_output
tags: register
- name: Set git_installed_version fact
set_fact: git_installed_version="{{ git_version_output.stdout }}"
tags: fact
- debug: msg="{{ git_installed_version}}"
- debug: msg="{{ git_version}}"
- name: Dump git_installed_version to file
debug: msg="success"
when: git_installed_version == git_version
tags: dump
- shell: cat "hello"
register: cat_content
- set_fact: my_deploy_dir="{{ item }}"
when: " item == 'Hello'"
with_items:
- "{{ cat_content.stdout_lines }}"
- debug: var=my_deploy_dir
- set_fact: "mid_build_stamp={{ my_deploy_dir | regex_replace('^(Hel)(.*)$','\\2') }}"
- debug: "msg={{ mid_build_stamp }}"
- name: Get list of files
shell: ls -1a
register: list_files
tags: register
- debug: "msg={{ list_files }}"
- set_fact: host_s="{{ item }}"
when: '"hosts.ini" in item'
with_items:
- "{{ list_files.stdout_lines }}"
- debug: var=host_s
- name: append
lineinfile:
dest: /tmp/foo
line: "{{ host_s }}"
regexp: THIS_SHOULD_NOT_EXISIS
state: present
create: yes
delegate_to: localhost