Skip to content

Commit ea9b9f8

Browse files
committed
Use sudo-enabled user for bootstrap
1 parent 26fbf13 commit ea9b9f8

File tree

5 files changed

+16
-9
lines changed

5 files changed

+16
-9
lines changed

galaxy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
namespace: "stackhpc"
22
name: "cephadm"
3-
version: "1.3.0"
3+
version: "1.4.0"
44
readme: "README.md"
55
authors:
66
- "Michal Nasiadka"

roles/cephadm/README.md

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
1-
cephadm
2-
=======
1+
# cephadm
32

43
This role bootstraps and configures Ceph using cephadm.
54

6-
Inventory
7-
---------
5+
## Prerequisites
6+
7+
### Host prerequisites
8+
9+
* The role assumes target hosts connection over SSH with user that has passwordless sudo configured.
10+
* Either direct Internet access or private registry with desired Ceph image accessible to all hosts is required.
11+
12+
### Inventory
813

914
This role assumes the existence of the following groups:
1015

@@ -19,8 +24,7 @@ Optional groups (those services will be deployed when group exists)::
1924

2025
All Ceph hosts must be in the `ceph` group.
2126

22-
Role variables
23-
--------------
27+
## Role variables
2428

2529
* General
2630
* `cephadm_ceph_release`: Ceph release to deploy (default: octopus)
@@ -35,6 +39,7 @@ Role variables
3539
* `cephadm_install_ceph_cli`: If enabled - ceph cli will be installed on the hosts (default: False)
3640
* `cephadm_ssh_public_key`: Location where ssh public key used by cephadm will be saved (default: /etc/ceph/cephadm.pub)
3741
* `cephadm_ssh_private_key`: Location where ssh private key used by cephadm will be saved (default: /etc/ceph/cephadm.id)
42+
* `cephadm_ssh_user`: Pre-existing user name that should be used for bootstrapping the cluster. User must have passwordless sudo enabled. Since 1.4.0 (default: `ansible_user`)
3843
* OSDs
3944
* `cephadm_osd_devices`: List of /dev/device paths to use (e.g. for multipath devices that can't be used using an OSD spec)
4045
Example:
@@ -56,7 +61,7 @@ Role variables
5661
db_devices:
5762
model: Dell Express Flash PM1725b 1.6TB SFF
5863
```
59-
64+
6065
* Registry
6166
* `cephadm_registry_url`: (default: not used)
6267
* `cephadm_registry_username`: (default: not used)

roles/cephadm/defaults/main.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ cephadm_enable_monitoring: False
1919
cephadm_install_ceph_cli: False
2020
cephadm_ssh_public_key: "/etc/ceph/cephadm.pub"
2121
cephadm_ssh_private_key: "/etc/ceph/cephadm.id"
22+
cephadm_ssh_user: "{{ ansible_user }}"
2223
# Networking
2324
cephadm_public_interface: ""
2425
cephadm_cluster_interface: ""

roles/cephadm/tasks/bootstrap.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
{{ firewalld }}
1616
--ssh-private-key={{ cephadm_ssh_private_key }}
1717
--ssh-public-key={{ cephadm_ssh_public_key }}
18+
--ssh-user "{{ cephadm_ssh_user }}"
1819
{% if cephadm_registry_url | length > 0 %}
1920
--registry-url={{ cephadm_registry_url }}
2021
--registry-username={{ cephadm_registry_username }}

roles/cephadm/tasks/prereqs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
vars:
5353
content: "{{ cephadm_ssh_public_key_slurp.content | b64decode if cephadm_check_ceph_id.stat.exists else cephadm_ssh_key.public_key }}"
5454
authorized_key:
55-
user: root
55+
user: "{{ cephadm_ssh_user }}"
5656
state: present
5757
key: "{{ content }}"
5858
become: true

0 commit comments

Comments
 (0)