post installation user data script

asked 2019-07-09 01:32:37 -0600

NewBie88 gravatar image

I want to do some operation post installation of instance creation.

My requirement is like below:- 1. Change the node name 2. Add few entries in fstab 3. Assign user to the instance and restrict the access to others apart from assigned users. 4. Install few packages like "yum install ftp -y" 5. Mount volume automatically

I have tried few things like given below:-

cloud-config

runcmd: - [ yum install, "ftp", -O, /tmp/output.txt ]

But getting below error:- /usr/bin/cloud-init-per: line 56: echo This host is being configured, please wait > /etc/nologin: No such file or directory load shell environment ERROR loading dynamic configuration, using cached version: ('Connection aborted.', gaierror(-2, 'Name or service not known')) load /etc/eecloud/region.txt

Please help me to solve this as I am new to openstack.

edit retag flag offensive close merge delete

Comments

yum install probably needs network connection to your repos, does your instance have access to the repos (floating ip)?

eblock gravatar imageeblock ( 2019-07-10 02:02:39 -0600 )edit

yum installation is successful from user data scripts so thanks everyone for that. Can you please let me know how I can restrict user access to newly created instance apart from the assigned users eg A and B is a scrum team.Instance assigned to A should not be accessible to scrum team B.

NewBie88 gravatar imageNewBie88 ( 2019-07-12 00:46:49 -0600 )edit

That question is not related to OpenStack, it's about system configuration. Probably the best option is a centralized user management (e.g. LDAP) where you can restrict access. Cloud-init is just for initial configuration after instance creation, not for systems management.

eblock gravatar imageeblock ( 2019-07-15 01:52:31 -0600 )edit