Commit 854f912f by Your Name

istall script fix

parent 9a15029f
...@@ -10,7 +10,7 @@ fi ...@@ -10,7 +10,7 @@ fi
FULLPATH=$(readlink -m $0) FULLPATH=$(readlink -m $0)
PREFIX=$(dirname $FULLPATH) PREFIX=$(dirname $FULLPATH)
pip install -r $PREFIX/requirements.txt python3 -m pip install -r $PREFIX/requirements.txt
$PREFIX/kvm-ok > /dev/null $PREFIX/kvm-ok > /dev/null
retv=$? retv=$?
...@@ -19,4 +19,4 @@ if [ $retv -eq 0 ]; then ...@@ -19,4 +19,4 @@ if [ $retv -eq 0 ]; then
EXTRAPARAMS="--kvm-present" EXTRAPARAMS="--kvm-present"
fi fi
python $PREFIX/install.py $EXTRAPARAMS $@ python3 $PREFIX/install.py $EXTRAPARAMS $@
...@@ -116,9 +116,12 @@ parser = argparse.ArgumentParser() ...@@ -116,9 +116,12 @@ parser = argparse.ArgumentParser()
parser.add_argument('--kvm-present', action='store_true', parser.add_argument('--kvm-present', action='store_true',
help='Installs with KVM hypervisor otherwise with QEMU.') help='Installs with KVM hypervisor otherwise with QEMU.')
parser.add_argument('--dev', action='store_true', parser.add_argument('--dev', action='store_true',
help='Installs Develpment version') help='Installs Development version')
parser.add_argument('--local', action='store_true', parser.add_argument('--local', action='store_true',
help='Installs Develpment version') help='Installs Local version')
parser.add_argument('--upstart', action='store_true',
help='Installs UpStart version')
args = parser.parse_args() args = parser.parse_args()
if args.dev or args.local: if args.dev or args.local:
...@@ -135,6 +138,7 @@ installer_sls = { ...@@ -135,6 +138,7 @@ installer_sls = {
'secret_key': ks.get_key('secret_key'), 'secret_key': ks.get_key('secret_key'),
'timezone': get_timezone(), 'timezone': get_timezone(),
'deployment_type': deployment_type, 'deployment_type': deployment_type,
'init_type': 'upstart' if args.upstart else 'systemd',
'admin_user': 'admin', 'admin_user': 'admin',
'admin_pass': input_admin_password(), 'admin_pass': input_admin_password(),
'database': { 'database': {
...@@ -193,14 +197,14 @@ opts = config.minion_config('') ...@@ -193,14 +197,14 @@ opts = config.minion_config('')
opts['file_client'] = 'local' opts['file_client'] = 'local'
# NOTE: False will cause salt to only display output # NOTE: False will cause salt to only display output
# for states that failed or states that have changes # for states that failed or states that have changes
opts['state_verbose'] = False opts['state_verbose'] = True
opts['file_roots'] = {'base': [join(PREFIX, 'salt')]} opts['file_roots'] = {'base': [join(PREFIX, 'salt')]}
opts['pillar_roots'] = {'base': [join(PREFIX, 'pillar')]} opts['pillar_roots'] = {'base': [join(PREFIX, 'pillar')]}
setup_console_logger(log_level='info') setup_console_logger(log_level='info')
caller = salt.client.Caller(mopts=opts) caller = salt.client.Caller(mopts=opts)
# Run install with salt # Run install with salt
with Halo(text='Installing', spinner='dots'): with Halo(text='Installing', spinner='dots'):
result = caller.function('state.sls', 'allinone', with_grains=True) result = caller.function('state.apply', 'allinone', with_grains=True)
# Count errors and print to console # Count errors and print to console
error_num = 0 error_num = 0
......
#user: cloud admin_pass: !!binary |
YWRtaW4=
#proxy_secret: xooquageire7uX1 admin_user: admin
#secret_key: Ga4aex3Eesohngo amqp:
#timezone: UTC host: 127.0.0.1
password: Y4zmHRFVSMaeLcp8
#deployment_type: local port: 5672
#init_type: systemd user: cloud
vhost: circle
#admin_user: admin cache: pylibmc://127.0.0.1:11211/
#admin_pass: admin database:
name: circle
#database: password: an065ZReMOuiwfGW
# name: circle user: circle
# user: circle deployment_type: local
# password: hoGei6paiN0ieda fwdriver:
external_if: !!binary |
#amqp: ZXRoMA==
# user: cloud external_net: !!binary |
# password: password MTAuOS4wLjE0Mi8xNg==
# host: 127.0.0.1 gateway: !!binary |
# port: 5672 MTAuOS4yNTUuMjU0
# vhost: circle management_if: ethy
queue_name: cloud-41125
#graphite: trunk_if: linkb
# user: monitor graphite:
# password: monitor host: 127.0.0.1
# host: 127.0.0.1 password: mCiHBgpsS9rL64vM
# port: 5672 port: 5672
# vhost: monitor queue: monitor
# queue: monitor secret_key: yGWhI0DsEoX7QJzl
# secret_key: ahf2aim7ahLeo8n user: monitor
vhost: monitor
#cache: pylibmc://127.0.0.1:11211/ init_type: systemd
nfs:
#nfs: directory: /datastore
# enabled: true enabled: true
# server: 10.0.0.115 network: 127.0.0.0/8
# network: 192.168.1.0/24 server: 127.0.0.1
# directory: /datastore proxy_secret: bQHgYBlX43aPop5h
secret_key: 95utIBEkwb0a7KSN
#storagedriver: storagedriver:
# queue_name: cloud-41125 queue_name: cloud-41125
timezone: Europe/Budapest
#fwdriver: user: cloud
# queue_name: cloud-41125 vmdriver:
# gateway: 10.0.255.254 hypervisor_type: qemu
# external_net: 10.9.0.142
# external_if: eth0
# trunk_if: linkb
# management_if: ethy
...@@ -2,10 +2,10 @@ include: ...@@ -2,10 +2,10 @@ include:
- profile - profile
- agentdriver - agentdriver
- manager - manager
- graphite # - graphite
- monitor-client - monitor-client
- storagedriver - storagedriver
- vmdriver - vmdriver
- vncproxy - vncproxy
- fwdriver # - fwdriver
- network - network
...@@ -29,8 +29,8 @@ symlink_dhcpd: ...@@ -29,8 +29,8 @@ symlink_dhcpd:
- force: True - force: True
cmd.run: cmd.run:
- name: /bin/systemctl daemon-reload - name: /bin/systemctl daemon-reload
- require: # - require:
- file: symlink_dhcpd # - file: symlink_dhcpd
{% endif %} {% endif %}
firewall2: firewall2:
...@@ -51,49 +51,11 @@ reload_firewall: ...@@ -51,49 +51,11 @@ reload_firewall:
- cmd: symlink_dhcpd - cmd: symlink_dhcpd
{% endif %} {% endif %}
{% if grains['os_family'] == 'RedHat' %} dhcpd:
net_config:
file.managed:
- name: /etc/sysconfig/network
- source: salt://network/files/network
- user: root
- group: root
- mode: 644
fix_dhcp:
cmd.script:
- name: salt://network/files/fix_dhcp.sh
- require:
- cmd: reload_firewall
- file: net_config
{% endif %}
isc-dhcp-server:
{% if grains['os_family'] == 'RedHat' or grains['os_family'] == 'Debian' %}
cmd.run:
- name: /bin/systemctl restart dhcpd
{% if grains['os_family'] == 'RedHat' %}
- watch:
- cmd: fix_dhcp
{% elif grains['os_family'] == 'Debian' %}
- watch:
- cmd: fix_dhcp_daemon_reload
{% endif %}
{% endif %}
service.running: service.running:
- enable: True - enable: True
{% if grains['os_family'] == 'RedHat' %}
- watch:
- cmd: fix_dhcp
{% elif grains['os_family'] == 'Debian' %}
- watch:
- cmd: fix_dhcp_daemon_reload
{% endif %}
{% if grains['os_family'] == 'RedHat' or grains['os_family'] == 'Debian' %}
- name: dhcpd
- require: - require:
- cmd: isc-dhcp-server - file: symlink_dhcpd
{% endif %}
{% if grains['os_family'] == 'Debian' %} {% if grains['os_family'] == 'Debian' %}
{# For next reboot #} {# For next reboot #}
...@@ -105,10 +67,4 @@ after_openvswitch_conf: ...@@ -105,10 +67,4 @@ after_openvswitch_conf:
- group: root - group: root
- template: jinja - template: jinja
- makedirs: True - makedirs: True
fix_dhcp_daemon_reload:
cmd.run:
- name: /bin/systemctl daemon-reload
- require:
- file: after_openvswitch_conf
{% endif %} {% endif %}
augeas_dependency: python-augeas:
pkg.installed: pkg.installed
- pkgs:
- python-augeas
libvirtconf: libvirtconf:
augeas.change: augeas.change:
...@@ -10,6 +8,13 @@ libvirtconf: ...@@ -10,6 +8,13 @@ libvirtconf:
- set listen_tcp 1 - set listen_tcp 1
- set listen_tls 0 - set listen_tls 0
- set auth_tcp "none" - set auth_tcp "none"
- require:
- pkg: python-augeas
cmd.run:
- user: root
- name: usermod -a -G libvirt {{ pillar['user'] }}
#/etc/default/libvirt-bin: #/etc/default/libvirt-bin:
# file.append: # file.append:
......
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 sign in to comment