Giter Site home page Giter Site logo

Comments (6)

rashbhat avatar rashbhat commented on May 20, 2024 1

create a file called main.yml in roles/tomcat/vars and include ' http_port=<port_no.>'

from ansible-examples.

syamv avatar syamv commented on May 20, 2024 1

Hi,

I have resolved the issue as below
Steps

  1. Create 'vars' directory in roles/tomcat
[root@instance-1 vars]# pwd
/home/user/ansible-tomcat/roles/tomcat/vars
  1. Copy the group_vars/tomcat-servers file to /roles/tomcat/vars/main.yml file
[root@instance-1 vars]# cat main.yml 
# Here are variables related to the Tomcat installation

http_port: 8086
https_port: 8443

# This will configure a default manager-gui user:

admin_username: admin
admin_password: adminsecret

from ansible-examples.

gvenka008c avatar gvenka008c commented on May 20, 2024

@rashbhat : how can i pass the host info using dynamic inventory? any thoughts?

#ansible-pull -d /home/gvenka008c/reponame --key-file=/home/users/rsa.id -U [email protected]:reponame.git playbook.yml

[WARNING]: provided hosts list is empty, only localhost is available

from ansible-examples.

fahdkecheri avatar fahdkecheri commented on May 20, 2024
TASK [tomcat : Configure Tomcat server] *************************************************************************************************************************************
task path: /root/ansible-examples/tomcat-standalone/roles/tomcat/tasks/main.yml:25
fatal: [Git]: FAILED! => {
    "changed": false,
    "failed": true,
    "msg": "AnsibleUndefinedVariable: 'http_port' is undefined"
}
fatal: [jenkin]: FAILED! => {
    "changed": false,
    "failed": true,
    "msg": "AnsibleUndefinedVariable: 'http_port' is undefined"
}
fatal: [nagios]: FAILED! => {
    "changed": false,
    "failed": true,
    "msg": "AnsibleUndefinedVariable: 'http_port' is undefined"
}
        to retry, use: --limit @/root/ansible-examples/tomcat-standalone/site.retry

PLAY RECAP ******************************************************************************************************************************************************************
Git                        : ok=11   changed=0    unreachable=0    failed=1
jenkin                     : ok=11   changed=0    unreachable=0    failed=1
nagios                     : ok=11   changed=0    unreachable=0    failed=1


[root@centos var]# cat main.yml
#re variables related to the Tomcat installation

include : http_port:8080
include : https_port:8443

# This will configure a default manager-gui user:
#
# admin_username: admin
# admin_password: adminsecret
#
[root@centos var]# pwd
/root/ansible-examples/tomcat-standalone/roles/tomcat/var
[root@centos var]#

I created file under create a file called main.yml in roles/tomcat/vars . Please help me to fix this error!

from ansible-examples.

himaja-ala avatar himaja-ala commented on May 20, 2024

Thanks It worked :)

from ansible-examples.

sreekanth564 avatar sreekanth564 commented on May 20, 2024

syamv -I faced the same issue and followed the same which you posted above. issue no more persisting.. but wanted to know why it is not taking the vars from group_vars folder wanted to know that can some one explain me

from ansible-examples.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.