Skip to content

Commit

Permalink
address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
juanvallejo committed Aug 31, 2017
1 parent 4a5f064 commit b411e30
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 10 deletions.
2 changes: 1 addition & 1 deletion images/installer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ COPY images/installer/origin-extra-root /
# install ansible and deps
RUN INSTALL_PKGS="python-lxml pyOpenSSL python2-cryptography openssl java-1.8.0-openjdk-headless python2-passlib httpd-tools openssh-clients origin-clients" \
&& yum install -y --setopt=tsflags=nodocs $INSTALL_PKGS \
&& EPEL_PKGS="PyYAML ansible python2-boto" \
&& EPEL_PKGS="ansible python2-boto" \
&& yum install -y epel-release \
&& yum install -y --setopt=tsflags=nodocs $EPEL_PKGS \
&& rpm -V $INSTALL_PKGS $EPEL_PKGS \
Expand Down
9 changes: 4 additions & 5 deletions images/installer/README_INVENTORY_GENERATOR.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ User configuration helps to provide additional details when creating an inventor
The default location of this file is in `root/etc/inventory-generator-config.yaml`. The
following configuration values are either expected or default to the given values when omitted:

- `openshift_cluster_user` (required):
- `openshift_cluster_user`:
- username of account capable of listing nodes in a cluster
- used for querying the cluster using `oc` to retrieve additional node information.

Expand All @@ -24,7 +24,7 @@ following configuration values are either expected or default to the given value

- `ansible_ssh_user`:
- specifies the ssh user to be used by Ansible when running the specified `PLAYBOOK_FILE` (see `README_CONTAINER_IMAGE.md` for additional information on this environment variable).
- if omitted, its value is defaulted to `ec2-user`
- if omitted, its value is defaulted to `root`

- `ansible_become_user`:
- specifies a user to "become" on the remote host. Used for privilege escalation.
Expand All @@ -47,10 +47,9 @@ Given a master node's `master-config.yaml` file, a user configuration file (see
```
docker run -u `id -u` \
-v $HOME/.ssh/id_rsa:/opt/app-root/src/.ssh/id_rsa:Z,ro \
-v /tmp/aws/ssh/config:/opt/app-root/src/.ssh/config:Z,ro \
-v /tmp/origin/master/admin.kubeconfig:/opt/app-root/src/.kube/config:Z \
-v /tmp/aws/master-config.yaml:/opt/app-root/src/master-config.yaml:Z \
-e OPTS="-v --become --become-user root" \
-v /tmp/origin/master/master-config.yaml:/opt/app-root/src/master-config.yaml:Z \
-e OPTS="-v --become-user root" \
-e PLAYBOOK_FILE=playbooks/byo/openshift-checks/health.yml \
-e GENERATE_INVENTORY=true \
-e USER=`whoami` \
Expand Down
3 changes: 1 addition & 2 deletions images/installer/root/usr/local/bin/generate
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ def main():
file_obj.close()

# set inventory values based on user configuration
ansible_ssh_user = user_config.get('ansible_ssh_user', 'ec2-user')
ansible_ssh_user = user_config.get('ansible_ssh_user', 'root')
ansible_become_user = user_config.get('ansible_become_user')

openshift_uninstall_images = user_config.get('openshift_uninstall_images', False)
Expand Down Expand Up @@ -289,7 +289,6 @@ def main():

# connect to remote host using `oc login...` and extract all possible node information
oc = OpenShiftClient(admin_kubeconfig_path)
oc.login(master_public_url, openshift_cluster_user)
nodes_config = yaml.load(oc.get_nodes())

# contains host types (e.g. masters, nodes, etcd)
Expand Down
2 changes: 0 additions & 2 deletions images/installer/root/usr/local/bin/user_setup
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ mkdir -p ${HOME}
chown ${USER_UID}:0 ${HOME}
chmod ug+rwx ${HOME}

chown ${USER_UID}:0 ${HOME}/.ssh/config

# runtime user will need to be able to self-insert in /etc/passwd
chmod g+rw /etc/passwd

Expand Down

0 comments on commit b411e30

Please sign in to comment.