offline.yml 778 B

123456789101112131415161718192021222324252627282930
  1. ---
  2. - name: Add cloud rpm repository {{ online_status }} {{ ansible_architecture }}
  3. template: src=yunion.repo.j2 dest=/etc/yum.repos.d/yunion.repo
  4. when:
  5. - is_centos_based is defined
  6. - name: ensure dest exists
  7. file: path=/opt/yunion/upgrade state=directory mode=0755
  8. - name: sync rpms to dest
  9. shell: |
  10. for i in {{ offline_nodes }}; do
  11. rsync -Pvar {{offline_data_path}}/{rpms,repodata,images} $i:/opt/yunion/upgrade &
  12. done
  13. wait
  14. args:
  15. executable: /bin/bash
  16. become: yes
  17. when:
  18. - is_centos_based is defined
  19. - offline_nodes is defined
  20. - offline_nodes |length > 0
  21. - name: make cache
  22. shell: |
  23. yum clean all
  24. yum -y --disablerepo='*' --enablerepo='yunion-repo-offline' makecache
  25. when:
  26. - is_centos_based is defined
  27. become: yes