-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathsample.yml
57 lines (49 loc) · 1.27 KB
/
sample.yml
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
---
- name: Create,initialize locally Bitbucket repository and push changes to remote repository
hosts: localhost
become: false
tasks:
- name: Create empty repository on Bitbucket
esp.bitbucket.bitbucket_repo:
username: '{{ bitbucket_username }}'
password: '{{ bitbucket_password }}'
repository: bar # alias: name
project_key: FOO
validate_certs: no
state: present
register: _result
- debug:
var: _result
- name: Initialize git repository
esp.bitbucket.git_init:
path: /tmp/bar
force: no
register: _result
- debug:
var: _result
- name: Create new files
ansible.builtin.file:
path: "/tmp/bar/{{ item }}"
state: touch
mode: u=rw,g=r,o=r
with_items:
- test_file1.txt
- test_file2.txt
- test_file3.txt
- name: Commit and push changes to the remote repository
esp.bitbucket.bitbucket_push:
username: '{{ bitbucket_username }}'
password: '{{ bitbucket_password }}'
repository: bar
project_key: FOO
msg: "Commit message"
path: /tmp/bar
commit: yes
committer:
name: jsmith
email: [email protected]
delete: no
validate_certs: no
register: _result
- debug:
var: _result