File tree Expand file tree Collapse file tree 4 files changed +50
-0
lines changed
examples/config/scp_with_ssh_password Expand file tree Collapse file tree 4 files changed +50
-0
lines changed Original file line number Diff line number Diff line change 1+ FROM sikalabs/sshd
2+ RUN \
3+ apt-get update && \
4+ apt-get install -y --no-install-recommends \
5+ sudo && \
6+ rm -rf /var/lib/apt/lists
7+ RUN useradd demo -s /bin/bash --create-home
8+ RUN echo "demo:demo" | chpasswd
9+ RUN echo "demo ALL=(ALL) ALL" >> /etc/sudoers
Original file line number Diff line number Diff line change 1+ IMAGE = "scp_with_ssh_password"
2+
3+ run :
4+ docker build --platform linux/amd64 -t $(IMAGE ) .
5+ docker run -p 2222:22 --name $(IMAGE ) -d $(IMAGE )
6+ sleep 3
7+ @echo
8+ gobble run
9+ @echo
10+ sshpass -p demo ssh ssh://demo@127.0.0.1:2222 cat /hello.txt
11+ sshpass -p demo ssh ssh://demo@127.0.0.1:2222 cat /template.txt
12+ @echo
13+ @make cleanup
14+
15+ cleanup :
16+ docker rm -f $(IMAGE )
Original file line number Diff line number Diff line change 1+ meta :
2+ schema_version : 3
3+ hosts :
4+ all :
5+ - ssh_target : demo@127.0.0.1
6+ ssh_port : 2222
7+ ssh_password : demo
8+ sudo_password : demo
9+ vars :
10+ hello : Ahoj
11+ world : Svete
12+ plays :
13+ - name : Test
14+ hosts : [all]
15+ tasks :
16+ - name : cp
17+ cp :
18+ local_src : hello.txt
19+ remote_dst : /hello.txt
20+ - name : template
21+ template :
22+ path : /template.txt
23+ template : |
24+ {{ .Vars.hello }} {{ .Vars.world }}
Original file line number Diff line number Diff line change 1+ Hello from Gobble!
You can’t perform that action at this time.
0 commit comments