Skip to content

Issue while running ansible playbook  #14

@athmadvara

Description

@athmadvara

command :
sudo ansible-playbook -i ansible_hosts buyer-app-install-for-ssl.yaml
Error :
Could not find or access '/Users/administrator/Desktop/ondc-sdk/deploying_ansible/../biap-client-node-js/config' on the Ansible Controller.\nIf you are using a module and expect the file to exist on the remote, see the remote_src option

buyer-app-install-for-ssl.yml Code:

  • name: Update web servers
    hosts: "{{ target }}"
    remote_user: ubuntu

    vars_prompt:

    • name: target
      prompt: enter the hostname which you might have mentioned in host file
      private: no

    • name: domain
      prompt: please enter the domain which will be serving the requests
      private: no

    • name: envtype
      prompt: please enter the env file to copy, we are appending to .env, hence value can be -staging etc
      private: no

    tasks:

    • name: Clone biap-client-node-js
      git:
      repo: "https://github.com/Open-network-for-digital-commerce/biap-client-node-js.git"
      dest: "/home/ubuntu/biap-client-node-js"
      version: "master"
      force: yes

    • name: Clone biap ui
      git:
      repo: "https://github.com/Open-network-for-digital-commerce/biap-app-ui-front.git"
      dest: "/home/ubuntu/biap-app-ui-front"
      version: "master"
      force: yes

    • name: Clone biap-bugzilla-service
      git:
      repo: "https://github.com/ONDC-Official/biap-bugzilla-service"
      dest: "/home/ubuntu/biap-bugzilla-service"
      version: "main"
      force: yes

    • name: Clone py ondc protocol
      git:
      repo: "https://github.com/ONDC-Official/py-protocol-layer.git"
      dest: "/home/ubuntu/py-ondc-protocol"
      version: "master"
      force: yes

    • name: Clone biap-igm-node-js
      git:
      repo: "https://github.com/ONDC-Official/biap-igm-node-js.git"
      dest: "/home/ubuntu/biap-igm-node-js"
      version: "main"
      force: yes

    • name: Copy config directory
      copy:
      src: "{{ playbook_dir }}/../biap-client-node-js/config"
      dest: "/home/ubuntu/biap-client-node-js/"
      owner: "ubuntu"
      group: "ubuntu"
      mode: "0755"

    • name: Copy config directory for igm
      copy:
      src: "{{ playbook_dir }}/../biap-igm-node-js/config"
      dest: "/home/ubuntu/biap-igm-node-js/"
      owner: "ubuntu"
      group: "ubuntu"
      mode: "0755"

    • name: Copy lets encrypt with domain replaced
      copy:
      src: "{{ playbook_dir }}/../init-letsencrypt.sh"
      dest: "/home/ubuntu/init-letsencrypt.sh"
      owner: "ubuntu"
      group: "ubuntu"
      mode: "0755"

    • name: replace domain with domain name
      replace:
      path: "/home/ubuntu/init-letsencrypt.sh"
      regexp: "domain_name"
      replace: "{{ domain }}"

    • name: copy Dockerfile without SSL as dockerfile in biap-app-ui-front
      copy:
      src: "{{ playbook_dir }}/../biap-app-ui-front/DockerfileWithoutSSL"
      dest: "/home/ubuntu/biap-app-ui-front/Dockerfile"
      owner: "ubuntu"
      group: "ubuntu"
      mode: "0755"

    • name: replace domain with in nginx.conf
      replace:
      path: "/home/ubuntu/biap-app-ui-front/nginx-without-ssl.conf"
      regexp: "domain_name"
      replace: "{{ domain }}"

    • name: copy env file with domain replaced
      copy:
      src: "{{ playbook_dir }}/../.env{{ envtype }}"
      dest: "/home/ubuntu/.env"
      owner: "ubuntu"
      group: "ubuntu"
      mode: "0755"

    • name: replace domain with domain name
      replace:
      path: "/home/ubuntu/.env"
      regexp: "domain_name"
      replace: "{{ domain }}"

    • name: Copy docker-compose file with domain replaced
      copy:
      src: "{{ playbook_dir }}/../docker-compose-with-images.yaml"
      dest: "/home/ubuntu/docker-compose.yml"
      owner: "ubuntu"
      group: "ubuntu"
      mode: "0755"

    • name: Run docker compose up
      shell: "cd /home/ubuntu/ && sudo docker-compose build && sudo docker-compose up -d"

    • name: run letsencrypt
      shell: "cd /home/ubuntu/ && sudo ./init-letsencrypt.sh"

Please find the below error details

The full traceback is:
Traceback (most recent call last):
File "/usr/local/Cellar/ansible/8.0.0/libexec/lib/python3.11/site-packages/ansible/plugins/action/copy.py", line 466, in run
source = self._find_needle('files', source)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/Cellar/ansible/8.0.0/libexec/lib/python3.11/site-packages/ansible/plugins/action/init.py", line 1455, in _find_needle
return self._loader.path_dwim_relative_stack(path_stack, dirname, needle)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/Cellar/ansible/8.0.0/libexec/lib/python3.11/site-packages/ansible/parsing/dataloader.py", line 341, in path_dwim_relative_stack
raise AnsibleFileNotFound(file_name=source, paths=[to_native(p) for p in search])
ansible.errors.AnsibleFileNotFound: Could not find or access '/Users/administrator/Desktop/ondc-sdk/deploying_ansible/../biap-client-node-js/config' on the Ansible Controller.
If you are using a module and expect the file to exist on the remote, see the remote_src option
fatal: [65.1.39.31]: FAILED! => {
"changed": false,
"invocation": {
"dest": "/home/ubuntu/biap-client-node-js/",
"group": "ubuntu",
"mode": "0755",
"module_args": {
"dest": "/home/ubuntu/biap-client-node-js/",
"group": "ubuntu",
"mode": "0755",
"owner": "ubuntu",
"src": "/Users/administrator/Desktop/ondc-sdk/deploying_ansible/../biap-client-node-js/config"
},
"owner": "ubuntu",
"src": "/Users/administrator/Desktop/ondc-sdk/deploying_ansible/../biap-client-node-js/config"
},
"msg": "Could not find or access '/Users/administrator/Desktop/ondc-sdk/deploying_ansible/../biap-client-node-js/config' on the Ansible Controller.\nIf you are using a module and expect the file to exist on the remote, see the remote_src option"
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions