Commit 9dbe837c authored by Leonard Marschke's avatar Leonard Marschke

install up to identity service

parent 3330e6cf
[mysqld]
bind-address = 192.168.3.10
default-storage-engine = innodb
innodb_file_per_table
max_connections = 4096
collation-server = utf8_general_ci
character-set-server = utf8
......@@ -19,7 +19,99 @@ def noSudoPassword():
sudo("echo \"fw ALL=(ALL) NOPASSWD: ALL\" >> /etc/sudoers")
@roles('controller', 'node')
@parallel
def noSSHPasswordAuthentication():
sudo("echo 'PasswordAuthentication no' >> /etc/ssh/sshd_config")
sudo("systemctl restart ssh")
@roles('controller', 'node')
def installVLAN():
sudo("apt-get install -y vlan")
@roles('controller', 'node')
def updateSystems():
sudo("apt-get update")
sudo("apt-get upgrade -y")
@roles('controller')
def configureChronyController():
sudo("echo 'allow 192.168.3.0/24' >> /etc/chrony/chrony.conf")
@roles('node')
def configureChronyNode():
sudo("sed -i -e 's/^pool.*$/server controller iburst/' /etc/chrony/chrony.conf")
@roles('controller', 'node')
def installChrony():
sudo("apt-get install -y chrony")
if env.host_string in env.roledefs['controller']:
execute("configureChronyController")
if env.host_string in env.roledefs['node']:
execute("configureChronyNode")
sudo("systemctl restart chrony")
@roles('controller', 'node')
def enableOpenstackRepo():
sudo("apt-get install -y software-properties-common")
sudo("add-apt-repository -y cloud-archive:newton")
sudo("apt-get update")
sudo("apt-get dist-upgrade -y")
with settings(warn_only=True):
reboot()
sudo("apt-get install -y python-openstackclient")
@roles('controller')
def installMariaDB():
sudo("apt-get install -y mariadb-server python-pymysql")
put("etc/mysql/mariadb.conf.d/99-openstack.cnf", "/etc/mysql/mariadb.conf.d/99-openstack.cnf", use_sudo=True)
sudo("systemctl restart mysql")
sudo("mysql_secure_installation")
@roles('controller')
def installRabbitMQ():
sudo("apt-get install -y rabbitmq-server")
sudo("rabbitmqctl add_user openstack lmm123")
sudo("rabbitmqctl set_permissions openstack '.*' '.*' '.*'")
@roles('controller')
def installMemcached():
sudo("apt-get install -y memcached python-memcache")
sudo("sed -i -e 's/^-l.*$/-l 192.168.3.10/' /etc/memcached.conf")
sudo("systemctl restart memcached")
identityServiceEnvs = {
"OS_USERNAME": "admin",
"OS_PASSWORD": "lmm123",
"OS_PROJECT_NAME": "admin",
"OS_USER_DOMAIN_NAME": "Default",
"OS_PROJECT_DOMAIN_NAME": "Default",
"OS_AUTH_URL": "http://controller:35357/v3",
"OS_IDENTITY_API_VERSION": "3",
}
@roles('controller')
def setupIdentityService():
put("identityServiceSetup.sql", "/tmp/identityServiceSetup.sql")
sudo("cat /tmp/identityServiceSetup.sql | mysql -u root -plmm123")
sudo("apt-get install -y keystone")
sudo("sed -i -e 's|^connection.*$|connection = mysql+pymysql://keystone:lmm123@controller/keystone|' /etc/keystone/keystone.conf")
sudo("sed -i -e 's|^provider.*$|provider = fernet|' /etc/keystone/keystone.conf")
sudo("keystone-manage db_sync", user="keystone")
sudo("keystone-manage fernet_setup --keystone-user keystone --keystone-group keystone")
sudo("keystone-manage credential_setup --keystone-user keystone --keystone-group keystone")
sudo("""keystone-manage bootstrap --bootstrap-password lmm123 \\
--bootstrap-admin-url http://controller:35357/v3/ \\
--bootstrap-internal-url http://controller:35357/v3/ \\
--bootstrap-public-url http://controller:5000/v3/ \\
--bootstrap-region-id RegionOne""")
sudo("sed -i -e 's/^ServerName.*$/ServerName controller/' /etc/apache2/apache2.conf")
sudo("systemctl restart apache2")
sudo("rm -f /var/lib/keystone/keystone.db")
@roles('controller', 'node')
def test():
print(env.host_string)
CREATE DATABASE keystone;
GRANT ALL PRIVILEGES ON keystone.* TO 'keystone'@'localhost' IDENTIFIED BY 'lmm123';
GRANT ALL PRIVILEGES ON keystone.* TO 'keystone'@'%' IDENTIFIED BY 'lmm123';
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment