Description of problem: We would like to have option to use ceph-ansible to only push the updated ceph.conf to the ceph nodes without performing any other action then update of ceph.conf. similar to "ceph-deploy config push" Version-Release number of selected component (if applicable): RHCS 3 How reproducible: Steps to Reproduce: 1. 2. 3. Actual results: Expected results: Additional info:
editing site.yml and only playing ceph-defaults and ceph-config failed: TASK [ceph-defaults : resolve device link(s)] ********************************************************************************************************************************************************************* fatal: [10.10.94.90]: FAILED! => {"failed": true, "msg": "The conditional check 'osd_scenario != 'lvm'' failed. The error was: error while evaluating conditional (osd_scenario != 'lvm'): 'osd_scenario' is undefined\n\nThe error appears to have been in '/usr/share/ceph-ansible/roles/ceph-defaults/tasks/facts.yml': line 128, column 3, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n- name: resolve device link(s)\n ^ here\n"} I suppose there is missing part which loads the osds.yml configuration with proper osd scenario. --------------------------------- scenario with tags, replace - role:ceph-defaults - role:ceph-config By - {role:ceph-defaults, tags: ['update_config'] } - {role:ceph-config, tags: ['update_config']} And then running : ansible-playbook site.yml --tags= 'update_config' ---------- #ansible-playbook tag.test.site.yml --tags='update_config' I have have tested the tag scenario and it looks working for the first glance, but it has its limitations: 1. I tried run it on deployed working Ceph just to check if it will distribute the changes to ceph.conf - passed 2. I have tested if it can be used to push ceph.conf on "new node"/"existing node added to new role - first run" - failed - it fails with the same error as in above # cat tag.test.site.yml --- # Defines deployment design and assigns role to server groups - hosts: - mons - agents - osds - mdss - rgws - nfss - restapis - rbdmirrors - clients - mgrs - iscsi-gws gather_facts: false tags: - always tasks: # If we can't get python2 installed before any module is used we will fail # so just try what we can to get it installed - name: check for python2 stat: path: /usr/bin/python ignore_errors: yes register: systempython2 - name: install python2 for debian based systems raw: sudo apt-get -y install python-simplejson ignore_errors: yes when: - systempython2.stat.exists is undefined or systempython2.stat.exists == false - name: install python2 for fedora raw: sudo dnf -y install python creates=/usr/bin/python ignore_errors: yes when: - systempython2.stat.exists is undefined or systempython2.stat.exists == false - name: gather and delegate facts setup: delegate_to: "{{ item }}" delegate_facts: True with_items: "{{ groups['all'] }}" - name: install required packages for fedora > 23 raw: sudo dnf -y install python2-dnf libselinux-python ntp when: - ansible_distribution == 'Fedora' - ansible_distribution_major_version|int >= 23 - hosts: mons gather_facts: false become: True roles: - {role: ceph-defaults, tags: ['update_config']} - ceph-common - {role: ceph-config, tags: ['update_config']} - ceph-mon - hosts: mgrs gather_facts: false become: True roles: - {role: ceph-defaults, tags: ['update_config']} - ceph-common - { role: ceph-config, when: "ceph_release_num.{{ ceph_release }} >= ceph_release_num.luminous" } - { role: ceph-mgr, when: "ceph_release_num.{{ ceph_release }} >= ceph_release_num.luminous" } - hosts: agents gather_facts: false become: True roles: - {role: ceph-defaults, tags: ['update_config']} - ceph-common - {role: ceph-config, tags: ['update_config']} - ceph-agent - hosts: osds gather_facts: false become: True roles: - {role: ceph-defaults, tags: ['update_config']} - ceph-common - {role: ceph-config, tags: ['update_config']} - ceph-osd - hosts: mdss gather_facts: false become: True roles: - {role: ceph-defaults, tags: ['update_config']} - ceph-common - {role: ceph-config, tags: ['update_config']} - ceph-mds - hosts: rgws gather_facts: false become: True roles: - {role: ceph-defaults, tags: ['update_config']} - ceph-common - {role: ceph-config, tags: ['update_config']} - ceph-rgw - hosts: nfss gather_facts: false become: True roles: - { role: ceph-defaults, tags: ['update_config']} - ceph-common - { role: ceph-config, when: "ceph_release_num.{{ ceph_release }} >= ceph_release_num.luminous", tags: ['update_config'] } - { role: ceph-nfs, when: "ceph_release_num.{{ ceph_release }} >= ceph_release_num.luminous" } - hosts: restapis gather_facts: false become: True roles: - {role: ceph-defaults, tags: ['update_config']} - ceph-common - {role: ceph-config, tags: ['update_config']} - ceph-restapi - hosts: rbdmirrors gather_facts: false become: True roles: - {role: ceph-defaults, tags: ['update_config']} - ceph-common - {role: ceph-config, tags: ['update_config']} - ceph-rbd-mirror - hosts: clients gather_facts: false become: True roles: - {role: ceph-defaults, tags: ['update_config']} - ceph-common - {role: ceph-config, tags: ['update_config']} - ceph-client - hosts: iscsi-gws gather_facts: false become: True roles: - {role: ceph-defaults, tags: ['update_config']} - ceph-common - { role: ceph-config, when: "ceph_release_num.{{ ceph_release }} >= ceph_release_num.luminous", tags: ['update_config']} - { role: ceph-iscsi-gw, when: "ceph_release_num.{{ ceph_release }} >= ceph_release_num.luminous" } ------------------------------
tested with changes introduced in: https://github.com/ceph/ceph-ansible/pull/2381/files tag.test.site.yml from comment #3 passed test with ceph-config and ceph-default in site.yml passed too # cat defcon_only.test.site.yml --- # Defines deployment design and assigns role to server groups - hosts: - mons - agents - osds - mdss - rgws - nfss - restapis - rbdmirrors - clients - mgrs - iscsi-gws gather_facts: false tags: - always tasks: # If we can't get python2 installed before any module is used we will fail # so just try what we can to get it installed - name: check for python2 stat: path: /usr/bin/python ignore_errors: yes register: systempython2 - name: install python2 for debian based systems raw: sudo apt-get -y install python-simplejson ignore_errors: yes when: - systempython2.stat.exists is undefined or systempython2.stat.exists == false - name: install python2 for fedora raw: sudo dnf -y install python creates=/usr/bin/python ignore_errors: yes when: - systempython2.stat.exists is undefined or systempython2.stat.exists == false - name: gather and delegate facts setup: delegate_to: "{{ item }}" delegate_facts: True with_items: "{{ groups['all'] }}" - name: install required packages for fedora > 23 raw: sudo dnf -y install python2-dnf libselinux-python ntp when: - ansible_distribution == 'Fedora' - ansible_distribution_major_version|int >= 23 - hosts: mons gather_facts: false become: True roles: - ceph-defaults - ceph-config - hosts: mgrs gather_facts: false become: True roles: - ceph-defaults - { role: ceph-config, when: "ceph_release_num.{{ ceph_release }} >= ceph_release_num.luminous" } - hosts: agents gather_facts: false become: True roles: - ceph-defaults - ceph-config - hosts: osds gather_facts: false become: True roles: - ceph-defaults - ceph-config - hosts: mdss gather_facts: false become: True roles: - ceph-defaults - ceph-config - hosts: rgws gather_facts: false become: True roles: - ceph-defaults - ceph-config - hosts: nfss gather_facts: false become: True roles: - ceph-defaults - { role: ceph-config, when: "ceph_release_num.{{ ceph_release }} >= ceph_release_num.luminous" } - hosts: restapis gather_facts: false become: True roles: - ceph-defaults - ceph-config - hosts: rbdmirrors gather_facts: false become: True roles: - ceph-defaults - ceph-config - hosts: clients gather_facts: false become: True roles: - ceph-defaults - ceph-config - hosts: iscsi-gws gather_facts: false become: True roles: - ceph-defaults - { role: ceph-config, when: "ceph_release_num.{{ ceph_release }} >= ceph_release_num.luminous" }