Ansible Symbolic Link Task Role Failure












-1















I am new to ansible and executing the following ansible task:



- name: Create symbolic links
file:
src: "{{ item.src }}"
dest: "{{ item.dest }}"
owner: "{{ jboss_usr }}"
group: "{{ jboss_grp }}"
state: link
with_items:
- { src: "/apps/etc/jboss", dest: "/etc/jboss" }
- { src: "/apps/var/log/jboss", dest: "/var/log/jboss" }


And I got the following error:



2018-12-21 21:27:23,469 p=15185 u=ex_sam |  failed: [hostname.x] (item={u'dest': u'/etc/jboss', u'src': u'/apps/etc/jboss'}) => {
"changed": false,
"invocation": {
"module_args": {
"attributes": null,
"backup": null,
"content": null,
"delimiter": null,
"dest": "/etc/jboss",
"diff_peek": null,
"directory_mode": null,
"follow": true,
"force": true,
"group": "jboss",
"mode": null,
"original_basename": null,
"owner": "jboss",
"path": "/etc/jboss",
"recurse": false,
"regexp": null,
"remote_src": null,
"selevel": null,
"serole": null,
"setype": null,
"seuser": null,
"src": "/apps/etc/jboss",
"state": "link",
"unsafe_writes": null,
"validate": null
}
},
"item": {
"dest": "/etc/jboss-as",
"src": "/apps/etc/jboss"
},
"msg": "Error while linking: [Errno 13] Permission denied",
"path": "/etc/jboss-as",
"state": "absent"
}


I am trying to find out why the symbolic link creation failed.



I read the following:



https://docs.ansible.com/ansible/latest/reference_appendices/common_return_values.html#id6



I says the "changed" attribute is a boolean indicating if the task had to make changes.



But, there are lots of null parameters in the invocation:module_args elements of the json



Does that mean the values are really “null” or they are being set to a default value?



I have looked into the ansible documentation and I am not sure if the invocation:module_args null values are representative of the outcome of the trying to create the symbolic link i.e. are the null input or output of executing the tasks.



I think some of the nulls are defaults, but will appreciate some helpful comments on the possible relation between the json returned in my ansible error log and the actual "Error while linking: [Errno 13] Permission denied".



Thanks all for you anticipated help.










share|improve this question





























    -1















    I am new to ansible and executing the following ansible task:



    - name: Create symbolic links
    file:
    src: "{{ item.src }}"
    dest: "{{ item.dest }}"
    owner: "{{ jboss_usr }}"
    group: "{{ jboss_grp }}"
    state: link
    with_items:
    - { src: "/apps/etc/jboss", dest: "/etc/jboss" }
    - { src: "/apps/var/log/jboss", dest: "/var/log/jboss" }


    And I got the following error:



    2018-12-21 21:27:23,469 p=15185 u=ex_sam |  failed: [hostname.x] (item={u'dest': u'/etc/jboss', u'src': u'/apps/etc/jboss'}) => {
    "changed": false,
    "invocation": {
    "module_args": {
    "attributes": null,
    "backup": null,
    "content": null,
    "delimiter": null,
    "dest": "/etc/jboss",
    "diff_peek": null,
    "directory_mode": null,
    "follow": true,
    "force": true,
    "group": "jboss",
    "mode": null,
    "original_basename": null,
    "owner": "jboss",
    "path": "/etc/jboss",
    "recurse": false,
    "regexp": null,
    "remote_src": null,
    "selevel": null,
    "serole": null,
    "setype": null,
    "seuser": null,
    "src": "/apps/etc/jboss",
    "state": "link",
    "unsafe_writes": null,
    "validate": null
    }
    },
    "item": {
    "dest": "/etc/jboss-as",
    "src": "/apps/etc/jboss"
    },
    "msg": "Error while linking: [Errno 13] Permission denied",
    "path": "/etc/jboss-as",
    "state": "absent"
    }


    I am trying to find out why the symbolic link creation failed.



    I read the following:



    https://docs.ansible.com/ansible/latest/reference_appendices/common_return_values.html#id6



    I says the "changed" attribute is a boolean indicating if the task had to make changes.



    But, there are lots of null parameters in the invocation:module_args elements of the json



    Does that mean the values are really “null” or they are being set to a default value?



    I have looked into the ansible documentation and I am not sure if the invocation:module_args null values are representative of the outcome of the trying to create the symbolic link i.e. are the null input or output of executing the tasks.



    I think some of the nulls are defaults, but will appreciate some helpful comments on the possible relation between the json returned in my ansible error log and the actual "Error while linking: [Errno 13] Permission denied".



    Thanks all for you anticipated help.










    share|improve this question



























      -1












      -1








      -1








      I am new to ansible and executing the following ansible task:



      - name: Create symbolic links
      file:
      src: "{{ item.src }}"
      dest: "{{ item.dest }}"
      owner: "{{ jboss_usr }}"
      group: "{{ jboss_grp }}"
      state: link
      with_items:
      - { src: "/apps/etc/jboss", dest: "/etc/jboss" }
      - { src: "/apps/var/log/jboss", dest: "/var/log/jboss" }


      And I got the following error:



      2018-12-21 21:27:23,469 p=15185 u=ex_sam |  failed: [hostname.x] (item={u'dest': u'/etc/jboss', u'src': u'/apps/etc/jboss'}) => {
      "changed": false,
      "invocation": {
      "module_args": {
      "attributes": null,
      "backup": null,
      "content": null,
      "delimiter": null,
      "dest": "/etc/jboss",
      "diff_peek": null,
      "directory_mode": null,
      "follow": true,
      "force": true,
      "group": "jboss",
      "mode": null,
      "original_basename": null,
      "owner": "jboss",
      "path": "/etc/jboss",
      "recurse": false,
      "regexp": null,
      "remote_src": null,
      "selevel": null,
      "serole": null,
      "setype": null,
      "seuser": null,
      "src": "/apps/etc/jboss",
      "state": "link",
      "unsafe_writes": null,
      "validate": null
      }
      },
      "item": {
      "dest": "/etc/jboss-as",
      "src": "/apps/etc/jboss"
      },
      "msg": "Error while linking: [Errno 13] Permission denied",
      "path": "/etc/jboss-as",
      "state": "absent"
      }


      I am trying to find out why the symbolic link creation failed.



      I read the following:



      https://docs.ansible.com/ansible/latest/reference_appendices/common_return_values.html#id6



      I says the "changed" attribute is a boolean indicating if the task had to make changes.



      But, there are lots of null parameters in the invocation:module_args elements of the json



      Does that mean the values are really “null” or they are being set to a default value?



      I have looked into the ansible documentation and I am not sure if the invocation:module_args null values are representative of the outcome of the trying to create the symbolic link i.e. are the null input or output of executing the tasks.



      I think some of the nulls are defaults, but will appreciate some helpful comments on the possible relation between the json returned in my ansible error log and the actual "Error while linking: [Errno 13] Permission denied".



      Thanks all for you anticipated help.










      share|improve this question
















      I am new to ansible and executing the following ansible task:



      - name: Create symbolic links
      file:
      src: "{{ item.src }}"
      dest: "{{ item.dest }}"
      owner: "{{ jboss_usr }}"
      group: "{{ jboss_grp }}"
      state: link
      with_items:
      - { src: "/apps/etc/jboss", dest: "/etc/jboss" }
      - { src: "/apps/var/log/jboss", dest: "/var/log/jboss" }


      And I got the following error:



      2018-12-21 21:27:23,469 p=15185 u=ex_sam |  failed: [hostname.x] (item={u'dest': u'/etc/jboss', u'src': u'/apps/etc/jboss'}) => {
      "changed": false,
      "invocation": {
      "module_args": {
      "attributes": null,
      "backup": null,
      "content": null,
      "delimiter": null,
      "dest": "/etc/jboss",
      "diff_peek": null,
      "directory_mode": null,
      "follow": true,
      "force": true,
      "group": "jboss",
      "mode": null,
      "original_basename": null,
      "owner": "jboss",
      "path": "/etc/jboss",
      "recurse": false,
      "regexp": null,
      "remote_src": null,
      "selevel": null,
      "serole": null,
      "setype": null,
      "seuser": null,
      "src": "/apps/etc/jboss",
      "state": "link",
      "unsafe_writes": null,
      "validate": null
      }
      },
      "item": {
      "dest": "/etc/jboss-as",
      "src": "/apps/etc/jboss"
      },
      "msg": "Error while linking: [Errno 13] Permission denied",
      "path": "/etc/jboss-as",
      "state": "absent"
      }


      I am trying to find out why the symbolic link creation failed.



      I read the following:



      https://docs.ansible.com/ansible/latest/reference_appendices/common_return_values.html#id6



      I says the "changed" attribute is a boolean indicating if the task had to make changes.



      But, there are lots of null parameters in the invocation:module_args elements of the json



      Does that mean the values are really “null” or they are being set to a default value?



      I have looked into the ansible documentation and I am not sure if the invocation:module_args null values are representative of the outcome of the trying to create the symbolic link i.e. are the null input or output of executing the tasks.



      I think some of the nulls are defaults, but will appreciate some helpful comments on the possible relation between the json returned in my ansible error log and the actual "Error while linking: [Errno 13] Permission denied".



      Thanks all for you anticipated help.







      ansible






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Jan 2 at 18:08









      StephenKing

      21.6k65483




      21.6k65483










      asked Jan 2 at 17:40









      olatomolatom

      55341125




      55341125
























          1 Answer
          1






          active

          oldest

          votes


















          0














          I think, is the permissions on /etc. So probably you need to add the option:



          become: true


          To your task.






          share|improve this answer
























          • Yes, I know it's permissions denied. But, that script used to work on other VMs. Where should the become:true be added and what is it's function? Also, what does module_args represent in the error msg json returned after executing task.

            – olatom
            Jan 2 at 20:44











          • I have seen that some existing play have the become:true , followed by become_user : root . I am guessing I will be prompted for root password when I execute the ansible task? I can't still find what the module args stands for though. Any ideas ?

            – olatom
            Jan 2 at 21:02












          Your Answer






          StackExchange.ifUsing("editor", function () {
          StackExchange.using("externalEditor", function () {
          StackExchange.using("snippets", function () {
          StackExchange.snippets.init();
          });
          });
          }, "code-snippets");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "1"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54010783%2fansible-symbolic-link-task-role-failure%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          0














          I think, is the permissions on /etc. So probably you need to add the option:



          become: true


          To your task.






          share|improve this answer
























          • Yes, I know it's permissions denied. But, that script used to work on other VMs. Where should the become:true be added and what is it's function? Also, what does module_args represent in the error msg json returned after executing task.

            – olatom
            Jan 2 at 20:44











          • I have seen that some existing play have the become:true , followed by become_user : root . I am guessing I will be prompted for root password when I execute the ansible task? I can't still find what the module args stands for though. Any ideas ?

            – olatom
            Jan 2 at 21:02
















          0














          I think, is the permissions on /etc. So probably you need to add the option:



          become: true


          To your task.






          share|improve this answer
























          • Yes, I know it's permissions denied. But, that script used to work on other VMs. Where should the become:true be added and what is it's function? Also, what does module_args represent in the error msg json returned after executing task.

            – olatom
            Jan 2 at 20:44











          • I have seen that some existing play have the become:true , followed by become_user : root . I am guessing I will be prompted for root password when I execute the ansible task? I can't still find what the module args stands for though. Any ideas ?

            – olatom
            Jan 2 at 21:02














          0












          0








          0







          I think, is the permissions on /etc. So probably you need to add the option:



          become: true


          To your task.






          share|improve this answer













          I think, is the permissions on /etc. So probably you need to add the option:



          become: true


          To your task.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Jan 2 at 18:10









          Luis CachoLuis Cacho

          111




          111













          • Yes, I know it's permissions denied. But, that script used to work on other VMs. Where should the become:true be added and what is it's function? Also, what does module_args represent in the error msg json returned after executing task.

            – olatom
            Jan 2 at 20:44











          • I have seen that some existing play have the become:true , followed by become_user : root . I am guessing I will be prompted for root password when I execute the ansible task? I can't still find what the module args stands for though. Any ideas ?

            – olatom
            Jan 2 at 21:02



















          • Yes, I know it's permissions denied. But, that script used to work on other VMs. Where should the become:true be added and what is it's function? Also, what does module_args represent in the error msg json returned after executing task.

            – olatom
            Jan 2 at 20:44











          • I have seen that some existing play have the become:true , followed by become_user : root . I am guessing I will be prompted for root password when I execute the ansible task? I can't still find what the module args stands for though. Any ideas ?

            – olatom
            Jan 2 at 21:02

















          Yes, I know it's permissions denied. But, that script used to work on other VMs. Where should the become:true be added and what is it's function? Also, what does module_args represent in the error msg json returned after executing task.

          – olatom
          Jan 2 at 20:44





          Yes, I know it's permissions denied. But, that script used to work on other VMs. Where should the become:true be added and what is it's function? Also, what does module_args represent in the error msg json returned after executing task.

          – olatom
          Jan 2 at 20:44













          I have seen that some existing play have the become:true , followed by become_user : root . I am guessing I will be prompted for root password when I execute the ansible task? I can't still find what the module args stands for though. Any ideas ?

          – olatom
          Jan 2 at 21:02





          I have seen that some existing play have the become:true , followed by become_user : root . I am guessing I will be prompted for root password when I execute the ansible task? I can't still find what the module args stands for though. Any ideas ?

          – olatom
          Jan 2 at 21:02




















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54010783%2fansible-symbolic-link-task-role-failure%23new-answer', 'question_page');
          }
          );

          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







          Popular posts from this blog

          MongoDB - Not Authorized To Execute Command

          How to fix TextFormField cause rebuild widget in Flutter

          in spring boot 2.1 many test slices are not allowed anymore due to multiple @BootstrapWith