группы в каждой по одному хосту
                  
                  
                  
                  
                  
                  - hosts: gourp2
                  
                  
                  
                  
                  
                    vars_files: defaults/main.yml
                  
                  
                  
                  
                  
                    tasks:
                  
                  
                      - name: uploads maps
                  
                  
                        import_tasks: tasks/upload_map.yml
                  
                  
                  
                  
                  
                  Хочу в плейбуке hosts: group2 таска, которая копирует файл лежащий на хосте из group1 на хост group2 — как это правильно сделать?
                  
                  
                  
                  
                  
                  в одну группу засунуть не могу, так как помимо копирования файла есть другие таски специально для разных груп
                  
                  
                  
                  
                  
                  - name: sync converted map on nodes
                  
                  
                    copy:
                  
                  
                      remote_src: no
                  
                  
                      src: /srv/ru-kz.osm.pbf
                  
                  
                      dest: ./
                  
                  
                      owner: root
                  
                  
                      group: root
                  
                  
                      mode: 0755
                  
                  
                    when: node_status.stdout == "backup" or node_status.stdout == "fault"
                  
                  
                  
                  
                  
                  Сейчас такая ошибка:
                  
                  
                  msg: |-
                  
                  
                      Could not find or access '/srv/ru-kz.osm.pbf' on the Ansible Controller.
                  
                  
                      If you are using a module and expect the file to exist on the remote, see the remote_src option
                  
                  
                
Положить файлы в роль или в хранилище
а что за хранилище? файл огромный для роли( и обновляется раз в неделю
https://docs.ansible.com/ansible/latest/collections/ansible/posix/synchronize_module.html
Обсуждают сегодня