forked from pnavarro/director-labs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcommands
139 lines (105 loc) · 3.34 KB
/
commands
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
patch ~/my_templates/puppet/manifests/overcloud_controller_pacemaker.pp < patches/overcloud_controller_pacemaker.patch
cat << EOF > ~/my_templates/pre-deployment.yaml
resource_registry:
OS::TripleO::ComputeExtraConfigPre: /home/stack/my_templates/extraconfig/compute-node-setup.yaml
EOF
cat << EOF >> ~/my_templates/pre-deployment.yaml
OS::TripleO::ControllerExtraConfigPre: /home/stack/my_templates/extraconfig/controller-node-setup.yaml
EOF
cat << EOF > ~/my_templates/extraconfig/compute-node-setup.yaml
heat_template_version: 2014-10-16
description: >
Example file to execute a script in the computes
parameters:
server:
type: string
default: ''
resources:
ExtraConfig:
type: OS::Heat::SoftwareConfig
properties:
group: script
config: {get_file: /home/stack/my_templates/extraconfig/compute-node-setup.sh}
ExtraDeployments:
type: OS::Heat::SoftwareDeployment
properties:
server: {get_param: server}
config: {get_resource: ExtraConfig}
actions: ['CREATE', 'UPDATE']
EOF
cat << EOF > ~/my_templates/extraconfig/compute-node-setup.sh
#!/bin/bash
touch /root/compute_test
EOF
cat << EOF > ~/my_templates/extraconfig/controller-node-setup.yaml
heat_template_version: 2014-10-16
description: >
Example file to execute a script in the controllers
parameters:
server:
type: string
default: ''
resources:
ExtraConfig:
type: OS::Heat::SoftwareConfig
properties:
group: script
config: {get_file: /home/stack/my_templates/extraconfig/controller-node-setup.sh}
ExtraDeployments:
type: OS::Heat::SoftwareDeployment
properties:
server: {get_param: server}
config: {get_resource: ExtraConfig}
actions: ['CREATE', 'UPDATE']
EOF
cat << EOF > ~/my_templates/extraconfig/controller-node-setup.sh
#!/bin/bash
mkdir -p /nfsshare/glance
mkdir -p /nfsshare/cinder
mkdir -p /nfsshare/nova
#sed -i '/# volume_list = \[.*/a volume_list = []' /etc/lvm/lvm.conf
dracut -H -f /boot/initramfs-$(uname -r).img $(uname -r)
EOF
cat << EOF > ~/my_templates/firstboot-environment.yaml
resource_registry:
OS::TripleO::NodeUserData: /home/stack/my_templates/firstboot-config.yaml
EOF
cat << EOF > ~/my_templates/firstboot-config.yaml
heat_template_version: 2014-10-16
resources:
userdata:
type: OS::Heat::MultipartMime
properties:
parts:
- config: {get_resource: repo_config}
repo_config:
type: OS::Heat::SoftwareConfig
properties:
group: script
config: {get_file: /home/stack/my_templates/node-setup.sh}
outputs:
OS::stack_id:
value: {get_resource: userdata}
EOF
cat << EOF > ~/my_templates/node-setup.sh
#!/bin/bash
#curl 'http://172.16.0.1:81/openstack.repo' -o '/etc/yum.repos.d/openstack.repo';
# Permit root login over SSH
sed -i 's/.*ssh-rsa/ssh-rsa/' /root/.ssh/authorized_keys
sed -i 's/PasswordAuthentication.*/PasswordAuthentication yes/g' /etc/ssh/sshd_config
sed -i 's/ChallengeResponseAuthentication.*/ChallengeResponseAuthentication yes/g' /etc/ssh/sshd_config
systemctl restart sshd
# Update the root password to something we know
echo redhat | sudo passwd root --stdin
#yum install -y device-mapper-multipath
#cat << FOE > /etc/multipath.conf
#defaults {
# find_multipaths yes
# user_friendly_names yes
#}
#blacklist {
#}
#FOE
#systemctl start multipathd.service
#systemctl enable multipathd.service
EOF