]> git.apps.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
containers: fix bug when looking for existing cluster
authorGuillaume Abrioux <gabrioux@redhat.com>
Wed, 10 Jan 2018 09:18:27 +0000 (10:18 +0100)
committerSébastien Han <seb@redhat.com>
Thu, 11 Jan 2018 14:08:35 +0000 (15:08 +0100)
When containerized deployment, `docker_exec_cmd` is not set before the
task which try to retrieve the current fsid is played, it means it
considers there is no existing fsid and try to generate a new one.

Typical error:

```
ok: [mon0 -> mon0] => {
    "changed": false,
    "cmd": [
        "ceph",
        "--connect-timeout",
        "3",
        "--cluster",
        "test",
        "fsid"
    ],
    "delta": "0:00:00.179909",
    "end": "2018-01-09 10:36:58.759846",
    "failed": false,
    "failed_when_result": false,
    "rc": 1,
    "start": "2018-01-09 10:36:58.579937"
}

STDERR:

Error initializing cluster client: Error('error calling conf_read_file: errno EINVAL',)
```

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
(cherry picked from commit 900f447c82c722539c6eed74c98bf1988a001b3d)
Signed-off-by: Sébastien Han <seb@redhat.com>
roles/ceph-defaults/tasks/facts.yml

index 0bf15683182452f429f79cc15a28a953312e3194..7b5edfa21fcd2066bc4e0ce2835f3449b306756c 100644 (file)
   when:
     - mon_use_fqdn
 
+- name: set_fact docker_exec_cmd
+  set_fact:
+    docker_exec_cmd: "docker exec ceph-mon-{{ hostvars[groups[mon_group_name][0]]['ansible_hostname'] }}"
+  delegate_to: "{{ groups[mon_group_name][0] }}"
+  when:
+    - containerized_deployment
+
 # this task shouldn't run in a rolling_update situation
 # because it blindly picks a mon, which may be down because
 # of the rolling update