Skip to content

Commit 787e206

Browse files
authored
Update Project-02.MD
1 parent ec4435d commit 787e206

File tree

1 file changed

+15
-13
lines changed

1 file changed

+15
-13
lines changed

SimpeDevOpsProjects/Project-02.MD

+15-13
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,10 @@ Test the connection "Test Connection"
2525

2626
### Part-02 - Execute job to connect
2727

28-
create a copywarfile.yml on Ansible
28+
create a copywarfile.yml on Ansible under /opt/playbooks
29+
2930
```sh
31+
# copywarfile.yml
3032
---
3133
- hosts: all
3234
become: true
@@ -37,27 +39,27 @@ create a copywarfile.yml on Ansible
3739
dest: /opt/apache-tomcat-8.5.32/webapps
3840
```
3941
Add tomcat server details to /etc/ansible/hosts (if you are using other hosts file update server info there)
40-
42+
```sh
4143
echo "<server_IP>" >> /etc/ansible/hosts
42-
44+
```
4345
Create *Jenkins job*, Fill the following details,
46+
4447
- *Source Code Management:*
4548
- Repository: `https://github.com/ValaxyTech/hello-world.git`
4649
- Branches to build : `*/master`
4750
- *Build:*
4851
- Root POM:`pom.xml`
4952
- Goals and options : `clean install package`
5053

51-
Add post-build steps
52-
- Send files or execute commands over SSH
53-
- SSH Server : `ansible_server`
54-
- Source fiels: webapp/target/*.war
55-
- Remote directory //opt//playbooks
56-
Post Steps
57-
Add post-build steps
58-
- Send files or execute commands over ssH
59-
- SSH Server : `ansible_server`
60-
- Exec command ansible-playbook /opt/playbooks/copywarfile.yml
54+
- *Add post-build steps*
55+
- Send files or execute commands over SSH
56+
- SSH Server : `ansible_server`
57+
- Source fiels: `webapp/target/*.war`
58+
- Remote directory: `//opt//playbooks`
59+
- *Add post-build steps*
60+
- Send files or execute commands over ssH
61+
- SSH Server : `ansible_server`
62+
- Exec command ansible-playbook /opt/playbooks/copywarfile.yml
6163

6264
Execute job and you should be able to seen build has been deployed on Tomcat server.
6365

0 commit comments

Comments
 (0)