Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    mitun_msdian
    @mitunmbj
    @sumanchowdare bro take a snapshot of the volumes and mount it to the 10Newec2 instance
    just surf for the cli command of adding volume to instance and provke that in ansible scripts
    matrixbot
    @matrixbot
    wilornel Hi #Ansible! I was wondering if you know of a certain repository that contains a playbook for installing kubernetes
    wilornel the binaries
    matrixbot
    @matrixbot
    matrixbot
    @matrixbot
    wilornel Hi Ansible team! Anyone active here?
    wilornel I got this thing with Packer and Ansible that I do not understand
    wilornel I setup the ansible playbook and have packer run it. However, ansible is not running some roles because "hosts: all" does not match localhost. Does anyone know what I'm talking about?
    wilornel Like who assigns what host name is the instance?
    wilornel I don't know if packer does that
    Matthew Davis
    @mateothegreat
    are you wanting to run it on localhost directly I take it?
    just set host: localhost
    hosts
    reneeshk
    @reneeshk
    Hello all
    Can anyone help me with this error? I'm just pasting last few lines of the error.
    File "/usr/local/lib/python3.6/site-packages/molecule/provisioner/ansible.py", line 713, in manage_inventory
    self._remove_vars()
    File "/usr/local/lib/python3.6/site-packages/molecule/provisioner/ansible.py", line 782, in _remove_vars
    shutil.rmtree(d)
    File "/usr/lib64/python3.6/shutil.py", line 486, in rmtree
    _rmtree_safe_fd(fd, path, onerror)
    File "/usr/lib64/python3.6/shutil.py", line 444, in _rmtree_safe_fd
    onerror(os.unlink, fullname, sys.exc_info())
    File "/usr/lib64/python3.6/shutil.py", line 442, in _rmtree_safe_fd
    os.unlink(name, dir_fd=topfd)
    PermissionError: [Errno 13] Permission denied: 'bitbucket_grp'
    matrixbot
    @matrixbot
    wilornel sounds like you got a permission denied man
    wilornel I feel like we are missing context to help
    wilornel Matthew Davis: Thanks
    wilornel Matthew Davis (Gitter): Thanks
    wilornel I'm getting a new issue
    wilornel amazon-ebs: mkdir: cannot create directory '/root': Permission denied
    matrixbot
    @matrixbot
    wilornel Do you have documentation on permission issues, and ansible trying to create a root dir?
    wilornel what is trying to create a root dir? The roles I'm using?
    matrixbot
    @matrixbot
    wilornel It's weird, I see ansible trying to ssh into localhost when clearly packer is building something in aws
    matrixbot
    @matrixbot
    wilornel I need help with apt_key.. I think that ansible is ssh'ed in as root but I'm getting an error that says that apt-key can only be ran by root.
    matrixbot
    @matrixbot
    wilornel Looks like there's an issue on this that was closed by ansible with no further comment? ansible/ansible#31145
    matrixbot
    @matrixbot
    wilornel Alright, I'm getting to it..
    wilornel Now, I don't know the best way to wait.
    gmldba
    @gmldba
    Im using vmware plugin and would like to use the tags for groups. I notice when I run ansible-inventory that tags are included to create groups. How can I add vm tags to the groups?
    ecaepp
    @ecaepp
    @reneeshk Going to need some more information about what you are doing and trying to accomplish.
    Terry Odom
    @TerryOdom
    Hell All. I get the following error when running a playbook but not sure how to address the colon like the error implies. Any suggestions? Thanks in advance
    The offending line appears to be:
      with_item:
        - { path: C:\ansible\apps\software\Notepad++\npp.7.5.3.Installer.x64.exe, arguments: /S }
                   ^ here
    ecaepp
    @ecaepp
    @TerryOdom try double quoting the path "C:\ansible\apps\software\Notepad++\npp.7.5.3.Installer.x64.exe"
    Terry Odom
    @TerryOdom
    ok, will try that and see. thanks
    Terry Odom
    @TerryOdom
    @ecaepp Thanks again! Just confirming your guidance worked. Much appreciated!!!
    ecaepp
    @ecaepp
    @TerryOdom No problem, if need anything else just let us know. :)
    jghal
    @jghal
    how can I put a variable interpolation inside curly braces? ie command: foobar -arg={{{myvar}}}
    the command expects the opening/closing curly brace in the argument value
    jghal
    @jghal
    blech, seems like {%raw%}{{%endraw%}{{myvar}}{%raw%}}{%endraw%} works but that's really verbose. is there any shorter syntax
    jghal
    @jghal
    {{ myvar | regex_replace('(.*)', '{\1}') }} gets the job done, seems a bit easier to read to me.
    matrixbot
    @matrixbot
    dziendobry Hi. I would like to know if someone can help me a on ansible-vault. I have a roles directory here and one role has a vars/main.yml file with the var I need to run my script and there is another file containing sensitive info call vault.yml (encrypted by ansible-vault). I would like to know how to use this vault.yml file. I first try to add it to main.yml using (include_vars: vault.yml) but it is not working (or I'm missing something)
    dziendobry I mean...I'm missing something for sure /o\
    pierremig
    @PierreOoo

    Hi I just bumped on this problem on my project, when I gather_facts, vars interpretation doesn't work anymore. This happends in ansible 2.4 and 2.8
    I'd like to keep vars interpretation when activating fact gathering.

    when gather_facts: no

    TASK [debug] **********************************************************************************************************************************
    ok: [test1-server] => (item={u'path': u'/tmp/somedir/a', u'name': u'some_name'}) => {
        "msg": {
            "name": "some_name", 
            "path": "/tmp/somedir/a"
        }

    when gather_facts: yes

    TASK [debug] **********************************************************************************************************************************
    ok: [test1-server] => (item={u'path': u'{{ dir_a }}', u'name': u'some_name'}) => {
        "msg": {
            "name": "some_name", 
            "path": "{{ dir_a }}"
        }
    }

    Playbook:

    - hosts: all
      gather_facts: yes
      vars:
        type: "dirs"
        dir_a: /tmp/somedir/a
        dirs:
          - name: "some_name"
            path: "{{ dir_a }}"
      tasks:
        - name: debug
          debug:
            msg: "{{ item }}"
          with_items:
            - "{{ vars[type]}}"
    sorry for the multiple edits
    Jay Carlson
    @nopdotcom
    Is vars a legit way of writing hostvars[inventory_hostname]?
    also I would never name a variable type :-)
    but yes, I can reproduce that
    pierremig
    @PierreOoo

    Hi Jay, here those play vars doesn't end up in hostvars[inventory_hostname].
    and yes type is a bad example for a variable
    I am using vars[] to force the interpretation of a string into a variable, which is the problem I have in my actual project.
    vars[dvars] => vars['dirs'] => [{ name: "dir_a", path: "/tmp/somedir/a"}]

    To be more precise my question is: What is the approprate way to make ansible inteprete variable that referes to other variables, and/or values(string) that referes to variables ? Espacially in this kind of nested cases !

    In this example dir_a is never interpreted through vars[dvar] (gather_facts value doesn't change anything)

    - hosts: all
      gather_facts: yes
      vars:
        dvar: "dirs"
        dir_a: /tmp/somedir/a
        dirs:
          - name: "dir_a"
            path: "{{ dir_a }}"
      tasks:
        - name: debug dvar
          debug:
            msg: "{{ dvar }}"
    
        - name: debug dirs
          debug:
            msg: "{{ dirs }}"
    
        - name: debug vars[dvar]
          debug:
            msg: "{{ vars[dvar] }}"
    
        - name: debug hostvars[inventory_hostname][dvar]
          debug:
            msg: "{{ hostvars[inventory_hostname][dvar] }}"
    TASK [debug dvar] ****************************************************************************************************************************************************************************
    ok: [test1-server] => {
        "msg": "dirs"
    }
    
    TASK [debug dirs] ****************************************************************************************************************************************************************************
    ok: [test1-server] => {
        "msg": [
            {
                "name": "dir_a", 
                "path": "/tmp/somedir/a"
            }
        ]
    }
    
    TASK [debug vars[dvar]] **********************************************************************************************************************************************************************
    ok: [test1-server] => {
        "msg": [
            {
                "name": "dir_a", 
                "path": "{{ dir_a }}"
            }
        ]
    }
    TASK [debug hostvars[inventory_hostname][dvar]] **********************************************************************************************************************************************
    fatal: [test1-server]: FAILED! => {"msg": "The task includes an option with an undefined variable. The error was: 'dict object' has no attribute u'dirs'\
    ....
    line 24, column 7, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n    - name: debug hostvars[inventory_hostname][dvar]\n      ^ here\n\nexception type: <class 'ansible.errors.AnsibleUndefinedVariable'>\nexception: 'dict object' has no attribute u'dirs'"}
    Jay Carlson
    @nopdotcom
    I wonder where vars is documented. omit was pretty well hidden.