I guess it fails because the provisioner user can't write in this directory? Or do you use become? Can you provide more context, the full packer template and playbooks.
On Wed, May 29, 2019 at 4:25 AM Muralikrishna Gutha <[email protected]> wrote: > Hello All, > > I am having issues while initializing virtualenv failes with "No such file > or directory", "rc": 2" error. > > Below is what i have as part of my playbook. Any help or advice would be > appreciated. > Using ansbile-local provisioners. > > # create the directory > - name: create virtualenv {{ virtualenv_dir }} directory > file: > path: "{{ virtualenv_dir }}" > state: directory > owner: root > group: root > mode: 0755 > # initialize the virtualenv > - name: initialize virtualenv > command: virtualenv {{ virtualenv_dir }} creates="{{ virtualenv_dir > }}/bin" > > amazon-ebs: changed: [127.0.0.1] > amazon-ebs: TASK [virtualenv_ve27 : create virtualenv /opt/python/ve27 > directory] ********** > amazon-ebs: changed: [127.0.0.1] > > *amazon-ebs: TASK [virtualenv_ve27 : initialize virtualenv] > ********************************* amazon-ebs: fatal: [127.0.0.1]: > FAILED! => {"changed": false, "cmd": "virtualenv /opt/python/ve27", "msg": > "[Errno 2] No such file or directory", "rc": 2}* > amazon-ebs: RUNNING HANDLER [ldap_setup : restart ssh] > ************************************* > > -- > Thanks, > Murali Gutha > > > > -- > This mailing list is governed under the HashiCorp Community Guidelines - > https://www.hashicorp.com/community-guidelines.html. Behavior in > violation of those guidelines may result in your removal from this mailing > list. > > GitHub Issues: https://github.com/mitchellh/packer/issues > IRC: #packer-tool on Freenode > --- > You received this message because you are subscribed to the Google Groups > "Packer" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/packer-tool/CADvtd2QZjcgPQdRzZUn0AmOP13FqUNQKbk8BKaDE%3DcSsi%2B4g1g%40mail.gmail.com > <https://groups.google.com/d/msgid/packer-tool/CADvtd2QZjcgPQdRzZUn0AmOP13FqUNQKbk8BKaDE%3DcSsi%2B4g1g%40mail.gmail.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list. GitHub Issues: https://github.com/mitchellh/packer/issues IRC: #packer-tool on Freenode --- You received this message because you are subscribed to the Google Groups "Packer" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/packer-tool/CALz9Rt9ofy1cCJ3rg65iMfdxeNizUk4e7-45FLaZZr1z8BGETQ%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
