目录架构图如上图所示
sls脚本详情如下:
Sync_Host: file.managed: - name: /etc/hosts - source: salt://state/files/hosts - user: root - group: root - mode: 644install_httpd: pkg.installed: - name: httpd - name: httpd-develhttpd_running: service.running: - name: httpd - enable: True - require: - pkg: install_httpd - watch: - file: httpd_confhttpd_conf: file.managed: - name: /etc/httpd/conf/httpd.conf - source: salt://state/files/httpd.conf - user: root - group: root - mode: 644 - template: jinja - defaults: hostname: localhostcp_openstack_source: file.managed: - name: /var/www/html/openstack-mitaka-rpms.tar.gz - source: salt://state/files/openstack-mitaka-rpms.tar.gz - user: root - group: root - mode: 644uncompress_openstackPack: cmd.run: - name: cd /var/www/html && tar xf openstack-mitaka-rpms.tar.gz && mv openstack-mitaka-rpms.tar.gz /tmpmv_old_epel: cmd.run: - name: cd /etc/yum.repos.d && mv *.repo /tmpmitaka_repo: file.managed: - name: /etc/yum.repos.d/mitaka.repo - source: salt://state/files/mitaka.repo - user: root - group: root - mode: 644 - template: jinja - default: IP: 192.168.74.155all_install: cmd.run: - name: yum clean all && yum install vim -yyum_conf: file.managed: - name: /etc/yum/yum-cron.conf - source: salt://state/files/yum-cron.conf - user: root - group: root - mode: 644install_openstack_pre: pkg.installed: - name: openstack_pre - pkgs: - python-openstackclient - openstack-selinux - chronystop_selinux_firewalld: cmd.run: - name: sed -i '/SELINUX/s/enforcing/disabled/' /etc/selinux/config && systemctl disable firewalld.service && systemctl stop firewalld.servicentp_conf: file.managed: - name: /etc/chrony.conf - source: salt://state/files/chrony.conf - user: root - group: root - mode: 644ntp_running: service.running: - name: chronyd - enable: True - require: - pkg: install_openstack_pre sync_time: cmd.run: - name: chronyc sources
因配置很长,就不贴出来了,我把用到的东西传到百度云里,需要的就自己下载吧 链接: http://pan.baidu.com/s/1o8yliFC 密码: mt3q,接下来继续完成吧,争取完成一键部署openstack架构