---
- name: sync new apps to nginx 
  hosts: supermaster
  become: yes
  tasks:
    - name: copy script
      copy:
        src: ../../config/script/apps-generator.py
        dest: /tmp/apps-generator.py
        owner: root
        group: root
        mode: u=rw,g=r,o=r

    - name: run script ans sync apps.conf
      shell: docker run --rm -it -v /tmp/apps-generator.py:/apps-generator.py -v /etc/nginx/sites-available/apps.conf:/tmp/apps.conf --network mother registry.vnfco.ir/library/python:3.10.1-alpine3.15  pip3 install pymongo && python3 /apps-generator.py
        

    
    