Running “mvn clean install” maven command using ansible module
up vote
0
down vote
favorite
I am trying to implement the CI/CD pipeline for my project. I am using Ansible , Docker and jenkins. SVN checkout , Image docker image building , image pushing to Dockerhub , Pulling and deploying etc every stages are planning to do using ansible roles.Now I successfully implemented sample svncheckout , image building and pushing and docker image deploying using ansible modules.
I am using Maven build tool.So here I have confusion that , after checkouting from svn repository , I need to run "mvn clean install" using ansible. Noow I am trying to find a ansible module. But i did ot got ansible module . For doing this is there any ansible module for maven like docker_image and svn ? How I can run maven commands using ansible role ?
maven docker ansible
add a comment |
up vote
0
down vote
favorite
I am trying to implement the CI/CD pipeline for my project. I am using Ansible , Docker and jenkins. SVN checkout , Image docker image building , image pushing to Dockerhub , Pulling and deploying etc every stages are planning to do using ansible roles.Now I successfully implemented sample svncheckout , image building and pushing and docker image deploying using ansible modules.
I am using Maven build tool.So here I have confusion that , after checkouting from svn repository , I need to run "mvn clean install" using ansible. Noow I am trying to find a ansible module. But i did ot got ansible module . For doing this is there any ansible module for maven like docker_image and svn ? How I can run maven commands using ansible role ?
maven docker ansible
Https://docs.ansible.com/ansible has a List of all modules page; and even if there isn’t specifically amvn installmodule you can always use the command module to do whatever you need to.
– David Maze
Nov 7 at 14:31
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I am trying to implement the CI/CD pipeline for my project. I am using Ansible , Docker and jenkins. SVN checkout , Image docker image building , image pushing to Dockerhub , Pulling and deploying etc every stages are planning to do using ansible roles.Now I successfully implemented sample svncheckout , image building and pushing and docker image deploying using ansible modules.
I am using Maven build tool.So here I have confusion that , after checkouting from svn repository , I need to run "mvn clean install" using ansible. Noow I am trying to find a ansible module. But i did ot got ansible module . For doing this is there any ansible module for maven like docker_image and svn ? How I can run maven commands using ansible role ?
maven docker ansible
I am trying to implement the CI/CD pipeline for my project. I am using Ansible , Docker and jenkins. SVN checkout , Image docker image building , image pushing to Dockerhub , Pulling and deploying etc every stages are planning to do using ansible roles.Now I successfully implemented sample svncheckout , image building and pushing and docker image deploying using ansible modules.
I am using Maven build tool.So here I have confusion that , after checkouting from svn repository , I need to run "mvn clean install" using ansible. Noow I am trying to find a ansible module. But i did ot got ansible module . For doing this is there any ansible module for maven like docker_image and svn ? How I can run maven commands using ansible role ?
maven docker ansible
maven docker ansible
edited Nov 7 at 14:03
kostix
29.6k647101
29.6k647101
asked Nov 7 at 13:36
Jacob
103422
103422
Https://docs.ansible.com/ansible has a List of all modules page; and even if there isn’t specifically amvn installmodule you can always use the command module to do whatever you need to.
– David Maze
Nov 7 at 14:31
add a comment |
Https://docs.ansible.com/ansible has a List of all modules page; and even if there isn’t specifically amvn installmodule you can always use the command module to do whatever you need to.
– David Maze
Nov 7 at 14:31
Https://docs.ansible.com/ansible has a List of all modules page; and even if there isn’t specifically a
mvn install module you can always use the command module to do whatever you need to.– David Maze
Nov 7 at 14:31
Https://docs.ansible.com/ansible has a List of all modules page; and even if there isn’t specifically a
mvn install module you can always use the command module to do whatever you need to.– David Maze
Nov 7 at 14:31
add a comment |
2 Answers
2
active
oldest
votes
up vote
1
down vote
If you couldn't find a module for your specific task, you have two options:
- Write your own in Python. Put them into 'library/' directory of the role or playbook.
- Use
commandorshellmodule to execute desired behavior.
Some systems are way too complex to be quickly implemented as ansible modules, nevertheless, it's often very easy to use their CLI.
add a comment |
up vote
0
down vote
If you cannot find any ansible plugin for maven. You can use the shell module to do that.
Here is an example:
- name: Running mvn clean
shell: "mvn clean install"
register: mvn_result
- name: "mvn clean task output"
debug:
var: mvn_result
add a comment |
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
If you couldn't find a module for your specific task, you have two options:
- Write your own in Python. Put them into 'library/' directory of the role or playbook.
- Use
commandorshellmodule to execute desired behavior.
Some systems are way too complex to be quickly implemented as ansible modules, nevertheless, it's often very easy to use their CLI.
add a comment |
up vote
1
down vote
If you couldn't find a module for your specific task, you have two options:
- Write your own in Python. Put them into 'library/' directory of the role or playbook.
- Use
commandorshellmodule to execute desired behavior.
Some systems are way too complex to be quickly implemented as ansible modules, nevertheless, it's often very easy to use their CLI.
add a comment |
up vote
1
down vote
up vote
1
down vote
If you couldn't find a module for your specific task, you have two options:
- Write your own in Python. Put them into 'library/' directory of the role or playbook.
- Use
commandorshellmodule to execute desired behavior.
Some systems are way too complex to be quickly implemented as ansible modules, nevertheless, it's often very easy to use their CLI.
If you couldn't find a module for your specific task, you have two options:
- Write your own in Python. Put them into 'library/' directory of the role or playbook.
- Use
commandorshellmodule to execute desired behavior.
Some systems are way too complex to be quickly implemented as ansible modules, nevertheless, it's often very easy to use their CLI.
answered Nov 9 at 15:15
George Shuklin
1,33551730
1,33551730
add a comment |
add a comment |
up vote
0
down vote
If you cannot find any ansible plugin for maven. You can use the shell module to do that.
Here is an example:
- name: Running mvn clean
shell: "mvn clean install"
register: mvn_result
- name: "mvn clean task output"
debug:
var: mvn_result
add a comment |
up vote
0
down vote
If you cannot find any ansible plugin for maven. You can use the shell module to do that.
Here is an example:
- name: Running mvn clean
shell: "mvn clean install"
register: mvn_result
- name: "mvn clean task output"
debug:
var: mvn_result
add a comment |
up vote
0
down vote
up vote
0
down vote
If you cannot find any ansible plugin for maven. You can use the shell module to do that.
Here is an example:
- name: Running mvn clean
shell: "mvn clean install"
register: mvn_result
- name: "mvn clean task output"
debug:
var: mvn_result
If you cannot find any ansible plugin for maven. You can use the shell module to do that.
Here is an example:
- name: Running mvn clean
shell: "mvn clean install"
register: mvn_result
- name: "mvn clean task output"
debug:
var: mvn_result
answered Nov 10 at 0:00
Yassine Fadhlaoui
717
717
add a comment |
add a comment |
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53190538%2frunning-mvn-clean-install-maven-command-using-ansible-module%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Https://docs.ansible.com/ansible has a List of all modules page; and even if there isn’t specifically a
mvn installmodule you can always use the command module to do whatever you need to.– David Maze
Nov 7 at 14:31