Deploy OpenStack Newton on CentOS hosts 95/26995/2
authorliyuenan <liyuenan@huawei.com>
Sat, 14 Jan 2017 03:31:08 +0000 (11:31 +0800)
committerJustin chi <chigang@huawei.com>
Sat, 14 Jan 2017 05:48:28 +0000 (05:48 +0000)
JIRA: COMPASS-518

Make Centos Newton ppa.
Update host Centos version to 7.3.
Support Centos Newton Deploy.
Support Ceph Deploy.

Change-Id: I6dd110cc10d425a9d590e1dcb5777ade5cce96aa
Signed-off-by: liyuenan <liyuenan@huawei.com>
38 files changed:
build.sh
build/build.conf
deploy/adapters/ansible/openstack/HA-ansible-multinodes.yml
deploy/adapters/ansible/openstack/templates/neutron.conf
deploy/adapters/ansible/roles/ceilometer_compute/vars/RedHat.yml
deploy/adapters/ansible/roles/ceilometer_controller/handlers/main.yml
deploy/adapters/ansible/roles/ceilometer_controller/tasks/ceilometer_config.yml
deploy/adapters/ansible/roles/ceilometer_controller/templates/wsgi-ceilometer.conf.j2
deploy/adapters/ansible/roles/ceilometer_controller/vars/Debian.yml
deploy/adapters/ansible/roles/ceilometer_controller/vars/RedHat.yml
deploy/adapters/ansible/roles/ceph-openstack/vars/RedHat.yml
deploy/adapters/ansible/roles/ceph-osd/files/ceph-crush-location.in [new file with mode: 0644]
deploy/adapters/ansible/roles/ceph-osd/tasks/install_osd.yml
deploy/adapters/ansible/roles/ceph-purge/tasks/main.yml
deploy/adapters/ansible/roles/common/tasks/main.yml
deploy/adapters/ansible/roles/common/templates/openstack_ppa_repo.repo.j2 [new file with mode: 0644]
deploy/adapters/ansible/roles/common/vars/RedHat.yml
deploy/adapters/ansible/roles/database/vars/RedHat.yml
deploy/adapters/ansible/roles/keystone/vars/RedHat.yml
deploy/adapters/ansible/roles/keystone/vars/main.yml
deploy/adapters/ansible/roles/neutron-compute/handlers/main.yml
deploy/adapters/ansible/roles/neutron-compute/templates/neutron.conf
deploy/adapters/ansible/roles/neutron-compute/vars/Debian.yml
deploy/adapters/ansible/roles/neutron-compute/vars/RedHat.yml
deploy/adapters/ansible/roles/nova-compute/tasks/main.yml
deploy/adapters/ansible/roles/nova-compute/templates/nova-compute.conf
deploy/adapters/ansible/roles/nova-compute/vars/Debian.yml
deploy/adapters/ansible/roles/setup-network/tasks/main.yml
deploy/adapters/ansible/roles/storage/tasks/main.yml
deploy/adapters/cobbler/kickstarts/default.ks
deploy/adapters/cobbler/snippets/kickstart_post_anamon
deploy/compass_conf/adapter/ansible_openstack_newton.conf
deploy/compass_conf/os/centos7.3.conf [new file with mode: 0755]
deploy/compass_conf/templates/cobbler/CentOS-7-Minimal-1611-x86_64/profile.tmpl [new file with mode: 0755]
deploy/compass_conf/templates/cobbler/CentOS-7-Minimal-1611-x86_64/system.tmpl [new file with mode: 0755]
deploy/conf/cluster.conf
repo/openstack/make_ppa/centos/rhel7/newton/download_pkg.tmpl [new file with mode: 0644]
repo/repo_func.sh

index 268604b..5765aa1 100755 (executable)
--- a/build.sh
+++ b/build.sh
@@ -88,7 +88,7 @@ function download_packages()
      for i in $CENTOS_BASE $LOADERS $CIRROS $APP_PACKAGE \
               $COMPASS_CORE $COMPASS_WEB $COMPASS_INSTALL $COMPASS_PKG \
               $PIP_REPO $PIP_OPENSTACK_REPO $ANSIBLE_MODULE \
-              $UBUNTU_ISO $CENTOS_ISO $XENIAL_NEWTON_PPA; do
+              $UBUNTU_ISO $CENTOS_ISO $XENIAL_NEWTON_PPA $CENTOS7_NEWTON_PPA; do
 
          if [[ ! $i ]]; then
              continue
@@ -128,8 +128,8 @@ function copy_file()
         cp $CACHE_DIR/`basename $CENTOS_ISO` $new/repos/cobbler/centos/iso/ -rf
     fi
 
-    if [[ $REDHAT7_ISO ]]; then
-        cp $CACHE_DIR/`basename $REDHAT7_ISO` $new/repos/cobbler/redhat/iso/ -rf
+    if [[  $CENTOS7_NEWTON_PPA ]]; then
+        cp $CACHE_DIR/`basename $CENTOS7_NEWTON_PPA` $new/repos/cobbler/centos/ppa/ -rf
     fi
 
     cp $CACHE_DIR/`basename $LOADERS` $new/ -rf || exit 1
index eed6b83..2699eb7 100644 (file)
@@ -18,22 +18,12 @@ export PIP_OPENSTACK_REPO=${PIP_OPENSTACK_REPO:-$PACKAGE_URL/pip-openstack.tar.g
 export ANSIBLE_MODULE=${ANSIBLE_MODULE:-https://github.com/openstack-ansible/openstack-ansible-modules.git}
 
 # OS ISO for provisioning
-export CENTOS_ISO=${CENTOS_ISO:-$PACKAGE_URL/CentOS-7-x86_64-Minimal-1511.iso}
+export CENTOS_ISO=${CENTOS_ISO:-$PACKAGE_URL/CentOS-7-x86_64-Minimal-1611.iso} # centos 7.3
 export UBUNTU_ISO=${UBUNTU_ISO:-$PACKAGE_URL/ubuntu-16.04-server-amd64.iso} # ubuntu 16.04
-#export UBUNTU_ISO1=${UBUNTU_ISO1:-$PACKAGE_URL/ubuntu-14.04.3-server-amd64.iso} # ubuntu 14.04
-#export REDHAT7_ISO=${REDHAT7_ISO:-$PACKAGE_URL/rhel-server-7.2-x86_64-dvd.iso} # rhel 7.2
 
 # OpenStack Packages for deployment
-#export TRUSTY_JUNO_PPA=${TRUSTY_JUNO_PPA:-$PACKAGE_URL/trusty-juno-ppa.tar.gz}
-#export TRUSTY_LIBERTY_PPA=${TRUSTY_LIBERTY_PPA:-$PACKAGE_URL/trusty-liberty-ppa.tar.gz}
-#export TRUSTY_MITAKA_PPA=${TRUSTY_MITAKA_PPA:-$PACKAGE_URL/trusty-mitaka-ppa.tar.gz}
-#export XENIAL_MITAKA_PPA=${XENIAL_MITAKA_PPA:-$PACKAGE_URL/xenial-mitaka-ppa.tar.gz}
 export XENIAL_NEWTON_PPA=${XENIAL_NEWTON_PPA:-$PPA_URL/xenial-newton-ppa.tar.gz}
-#export CENTOS7_JUNO_PPA=${CENTOS7_JUNO_PPA:-$PACKAGE_URL/centos7-juno-ppa.tar.gz}
-#export CENTOS7_KILO_PPA=${CENTOS7_KILO_PPA:-$PACKAGE_URL/centos7-kilo-ppa.tar.gz}
-#export CENTOS7_LIBERTY_PPA=${CENTOS7_LIBERTY_PPA:-$PACKAGE_URL/centos7-liberty-ppa.tar.gz}
-#export CENTOS7_MITAKA_PPA=${CENTOS7_MITAKA_PPA:-$PACKAGE_URL/centos7-mitaka-ppa.tar.gz}
-#export REDHAT7_OSP9_PPA=${REDHAT7_OSP9_PPA:-$PACKAGE_URL/redhat7-osp9-ppa.tar.gz}
+export CENTOS7_NEWTON_PPA=${CENTOS7_NEWTON_PPA:-$PACKAGE_URL/centos7-newton-ppa.tar.gz}
 
 # SDN Packages for integration
 export APP_PACKAGE=${APP_PACKAGE:-$FEATURE_URL/packages.tar.gz}
index 49caa87..840a5cf 100644 (file)
@@ -8,7 +8,6 @@
 verbose = {{ VERBOSE }}
 debug = {{ VERBOSE }}
 state_path = /var/lib/neutron
-lock_path = $state_path/lock
 notify_nova_on_port_status_changes = True
 notify_nova_on_port_data_changes = True
 log_dir = /var/log/neutron
@@ -110,3 +109,6 @@ rabbit_host = {{ rabbit_host }}
 rabbit_password = {{ RABBIT_PASS }}
 rabbit_port = 5672
 rabbit_userid = {{ RABBIT_USER }}
+
+[oslo_concurrency]
+lock_path = $state_path/lock
index c5778a4..f3d5f0e 100644 (file)
@@ -15,3 +15,6 @@ ceilometer_packages:
 ceilometer_services:
   - openstack-ceilometer-compute
   - openstack-nova-compute
+
+nova_services:
+  - openstack-nova-compute
index 1507c6e..2d0e315 100644 (file)
@@ -16,7 +16,9 @@
   with_items: "{{ glance_cinder_services }}"
 
 - name: reload apache server
-  service: name=apache2 state=reloaded
+  service: name={{ item }} state=reloaded
+  with_items: "{{ services }}"
 
 - name: restart apache server
-  service: name=apache2 state=restarted enabled=yes
+  service: name={{ item }} state=restarted enabled=yes
+  with_items: "{{ services }}"
index 694cc0d..b2d58d4 100644 (file)
@@ -9,25 +9,35 @@
 ---
 - include_vars: "{{ ansible_os_family }}.yml"
 
+- name: assure listen port exist
+  lineinfile:
+    dest: '{{ apache_config_dir }}/ports.conf'
+    regexp: "^Listen {{ internal_ip }}:8777"
+    line: "Listen {{ internal_ip }}:8777"
+  notify: restart apache server
+
+- name: update apache2 configs
+  template:
+    src: wsgi-ceilometer.conf.j2
+    dest: '{{ apache_config_dir }}/sites-available/ceilometer.conf'
+  when: ansible_os_family == 'Debian'
+  notify: reload apache server
+
 - name: update apache2 configs
   template:
     src: wsgi-ceilometer.conf.j2
-    dest: /etc/apache2/sites-available/ceilometer.conf
+    dest: '{{ apache_config_dir }}/ceilometer.conf'
+  when: ansible_os_family == 'RedHat'
   notify: reload apache server
 
 - name: enable ceilometer server
   file:
-    src: /etc/apache2/sites-available/ceilometer.conf
-    dest: /etc/apache2/sites-enabled/ceilometer.conf
+    src: "{{ apache_config_dir }}/sites-available/ceilometer.conf"
+    dest: "{{ apache_config_dir }}/sites-enabled/ceilometer.conf"
     state: "link"
   when: ansible_os_family == 'Debian'
   notify: reload apache server
 
-- name: assure listen port exist
-  shell: echo "Listen {{ internal_ip }}:8777" >> /etc/apache2/ports.conf
-  notify:
-    - restart apache server
-
 - name: copy glance & cinder configs
   template:
     src: "{{ item }}"
index 9909f80..c876efd 100644 (file)
@@ -6,10 +6,10 @@
 <VirtualHost {{ internal_ip }}:8777>
     WSGIDaemonProcess ceilometer-api processes=4 threads={{ work_threads }} user=ceilometer group=ceilometer display-name=%{GROUP}
     WSGIProcessGroup ceilometer-api
-    WSGIScriptAlias / /usr/lib/python2.7/dist-packages/ceilometer/api/app.wsgi
+    WSGIScriptAlias / {{ WSGIScriptAlias_path }}
     WSGIApplicationGroup %{GLOBAL}
-    ErrorLog /var/log/apache2/ceilometer_error.log
-    CustomLog /var/log/apache2/ceilometer_access.log combined
+    ErrorLog /var/log/{{ http_service_name }}/ceilometer_error.log
+    CustomLog /var/log/{{ http_service_name }}/ceilometer_access.log combined
 
     <Directory /usr/lib/python2.7/dist-packages/ceilometer/api/>
         <IfVersion >= 2.4>
@@ -22,4 +22,4 @@
     </Directory>
 </VirtualHost>
 
-WSGISocketPrefix /var/run/apache2
+WSGISocketPrefix /var/run/{{ http_service_name }}
index de86053..1456ee5 100644 (file)
@@ -12,6 +12,7 @@ ceilometer_packages:
   - ceilometer-collector
   - ceilometer-agent-central
   - ceilometer-agent-notification
+  - ceilometer-agent-compute
   - python-ceilometerclient
 
 ceilometer_services:
@@ -24,3 +25,10 @@ glance_cinder_services:
   - glance-api
   - cinder-api
   - cinder-scheduler
+
+services:
+  - apache2
+
+apache_config_dir: /etc/apache2
+http_service_name: apache2
+WSGIScriptAlias_path: /usr/lib/python2.7/dist-packages/ceilometer/api/app.wsgi
index de86053..08d1a92 100644 (file)
@@ -8,19 +8,28 @@
 ##############################################################################
 ---
 ceilometer_packages:
-  - ceilometer-api
-  - ceilometer-collector
-  - ceilometer-agent-central
-  - ceilometer-agent-notification
+  - openstack-ceilometer-api
+  - openstack-ceilometer-collector
+  - openstack-ceilometer-central
+  - openstack-ceilometer-notification
+  - openstack-ceilometer-compute
   - python-ceilometerclient
 
 ceilometer_services:
-  - ceilometer-agent-central
-  - ceilometer-agent-notification
-  - ceilometer-collector
+  - openstack-ceilometer-central
+  - openstack-ceilometer-notification
+  - openstack-ceilometer-api
+  - openstack-ceilometer-collector
 
 glance_cinder_services:
-  - glance-registry
-  - glance-api
-  - cinder-api
-  - cinder-scheduler
+  - openstack-glance-registry
+  - openstack-glance-api
+  - openstack-cinder-api
+  - openstack-cinder-scheduler
+
+services:
+  - httpd
+
+apache_config_dir: /etc/httpd/conf.d
+http_service_name: httpd
+WSGIScriptAlias_path: /usr/lib/python2.7/site-packages/ceilometer/api/app.wsgi
diff --git a/deploy/adapters/ansible/roles/ceph-osd/files/ceph-crush-location.in b/deploy/adapters/ansible/roles/ceph-osd/files/ceph-crush-location.in
new file mode 100644 (file)
index 0000000..d763751
--- /dev/null
@@ -0,0 +1,79 @@
+#!/bin/sh
+#
+# Generate a CRUSH location for the given entity
+#
+# The CRUSH location consists of a list of key=value pairs, separated
+# by spaces, all on a single line.  This describes where in CRUSH
+# hierarhcy this entity should be placed.
+#
+# Arguments:
+#   --cluster <clustername>   name of the cluster (see /etc/ceph/$cluster.conf)
+#   --type <osd|mds|client>   daemon/entity type
+#   --id <id>                 id (osd number, mds name, client name)
+#
+
+# if we start up as ./ceph-crush-location, assume everything else is
+# in the current directory too.
+if [ `dirname $0` = "." ] && [ $PWD != "/usr/bin" ]; then
+    BINDIR=.
+    SBINDIR=.
+    LIBDIR=.
+    ETCDIR=.
+else
+    BINDIR=@bindir@
+    SBINDIR=@prefix@/sbin
+    LIBDIR=@libdir@/ceph
+    ETCDIR=@sysconfdir@/ceph
+fi
+
+usage_exit() {
+    echo "usage: $0 [--cluster <cluster>] --id <id> --type <osd|mds|client>"
+    exit
+}
+
+cluster="ceph"
+type=""
+id=""
+while [ $# -ge 1 ]; do
+    case $1 in
+       --cluster | -C)
+           shift
+           cluster="$1"
+           shift
+           ;;
+       --id | -i)
+           shift
+           id="$1"
+           shift
+           ;;
+       --type | -t)
+           shift
+           type="$1"
+           shift
+           ;;
+       *)
+           echo "unrecognized option '$1'"
+           usage_exit
+           ;;
+    esac
+done
+
+if [ -z "$type" ]; then
+    echo "must specify entity type"
+    usage_exit
+fi
+
+if [ -z "$id" ]; then
+    echo "must specify id"
+    usage_exit
+fi
+
+# try a generic location
+location="$($BINDIR/ceph-conf --cluster=${cluster:-ceph} --name=$type.$id --lookup crush_location || :)"
+if [ -n "$location" ]; then
+    echo $location
+    exit 0
+fi
+
+# spit out something generic
+echo "host=$(hostname -s) root=default"
index 78d62f6..2a9ea3a 100644 (file)
   shell: chown -R ceph:ceph /var/local/osd
   when: ansible_os_family == "Debian"
 
+- name: copy ceph-crush-location to osd host
+  copy:
+    src: ceph-crush-location.in
+    dest: /usr/bin/ceph-crush-location
+    mode: 0755
+  when: ansible_os_family == "RedHat"
+
 - name: activate osd node
   shell: ceph-disk activate /var/local/osd
 
index 5364cc8..663641b 100644 (file)
@@ -20,6 +20,7 @@
   tags:
     - ceph_purge
     - ceph_deploy
+  when: ansible_os_family == "Debian"
 
 - name: purge ceph
   shell: |
@@ -29,6 +30,7 @@
   tags:
     - ceph_purge
     - ceph_deploy
+  when: ansible_os_family == "Debian"
 
 - name: remove monmap
   file: path="/tmp/monmap" state="absent"
index 135d535..69fc1d4 100644 (file)
   shell: awk -F'=' '/compass_server/ {print $2}' /etc/compass.conf
   register: COMPASS_SERVER
 
+- name: add yum repository for openstack
+  template: src=openstack_ppa_repo.repo.j2 dest=/etc/yum.repos.d/openstack_ppa_repo.repo
+  when: ansible_os_family == "RedHat"
+
 - name: update compass-core name and ip to hosts files
   shell: |
     echo "# compass" >> /etc/hosts;
diff --git a/deploy/adapters/ansible/roles/common/templates/openstack_ppa_repo.repo.j2 b/deploy/adapters/ansible/roles/common/templates/openstack_ppa_repo.repo.j2
new file mode 100644 (file)
index 0000000..bc95ef4
--- /dev/null
@@ -0,0 +1,7 @@
+[openstack_ppa_repo]
+name=openstack - openstack_repo
+proxy=_none_
+baseurl=http://{{ COMPASS_SERVER.stdout_lines[0] }}/cblr/repo_mirror/centos7-newton-ppa
+enabled=1
+gpgcheck=0
+skip_if_unavailable=1
index 8143e1c..0697fec 100644 (file)
@@ -14,6 +14,12 @@ packages:
   - gcc
   - redhat-lsb-core
   - python-crypto
+  - wget
+  - yum-plugin-priorities
+  - vim
+  - lsof
+  - strace
+  - net-tools
 
 pip_packages:
   - crudini
index aed1ac9..62f331c 100644 (file)
@@ -16,7 +16,6 @@ maridb_packages:
   - MariaDB-Galera-server
   - MariaDB-client
   - galera
-  - MySQL-python
 
 mongodb_packages:
   - mongo-10gen-server
index 38f8d91..63ddce3 100644 (file)
@@ -11,6 +11,7 @@ cron_path: "/var/spool/cron"
 
 packages:
   - openstack-keystone
+  - python-openstackclient
 
 services:
   - httpd
index 5dbc562..65ae409 100644 (file)
@@ -9,7 +9,6 @@
 ---
 packages_noarch:
   - python-keystoneclient
-  - python3-keystoneclient
 
 services_noarch: []
 os_services:
index 8373798..1e2ad35 100644 (file)
@@ -12,4 +12,4 @@
   with_items: "{{ services | union(services_noarch) }}"
 
 - name: restart nova-compute services
-  service: name=nova-compute state=restarted enabled=yes
+  service: name={{ nova_compute_service }}  state=restarted enabled=yes
index a676e95..d74435f 100644 (file)
@@ -2,7 +2,6 @@
 verbose = {{ VERBOSE }}
 debug = {{ VERBOSE }}
 state_path = /var/lib/neutron
-lock_path = $state_path/lock
 notify_nova_on_port_status_changes = True
 notify_nova_on_port_data_changes = True
 log_dir = /var/log/neutron
@@ -103,3 +102,6 @@ rabbit_host = {{ rabbit_host }}
 rabbit_password = {{ RABBIT_PASS }}
 rabbit_port = 5672
 rabbit_userid = {{ RABBIT_USER }}
+
+[oslo_concurrency]
+lock_path = $state_path/lock
index 65dda6b..8486a1a 100644 (file)
@@ -16,3 +16,6 @@ services:
   - openvswitch
   - neutron-openvswitch-agent
   - libvirtd
+
+nova_compute_service:
+  - openstack-nova-compute
index 417f877..f918344 100644 (file)
@@ -50,8 +50,3 @@
   shell: rm /var/lib/nova/nova.sqlite || touch nova.sqlite.removed
 
 - meta: flush_handlers
-
-- name: restart nova-compute and libvirt-bin
-  shell: >
-    service nova-compute restart;
-    service libvirt-bin restart;
index 305d408..a46c6b8 100644 (file)
@@ -1,11 +1,12 @@
 [DEFAULT]
-compute_driver=libvirt.LibvirtDriver
+compute_driver = libvirt.LibvirtDriver
 force_raw_images = true
 [libvirt]
+cpu_mode = none
 {% if kvm_cpu_num.stdout_lines[0]|int == 0 %}
-virt_type=qemu
+virt_type = qemu
 {% else %}
-virt_type=kvm
+virt_type = kvm
 {% endif %}
 images_type = raw
-mem_stats_period_seconds=0
+mem_stats_period_seconds = 0
index 5e5a093..9edee35 100644 (file)
 
 - name: add to boot scripts
   shell: update-rc.d net_init defaults
+  when: ansible_os_family == "Debian"
+
+- name: add to boot scripts
+  shell: |
+    chkconfig --add net_init;
+    chkconfig --level 2345 net_init on;
+  when: ansible_os_family == 'RedHat'
 
 - meta: flush_handlers
index b4263d6..b054be9 100755 (executable)
   tags:
     - storage
 
-
-- name: enable service
+- name: add to boot scripts
   shell: update-rc.d storage defaults
+  when: ansible_os_family == "Debian"
+  tags:
+    - storage
+
+- name: add to boot scripts
+  shell: |
+    chkconfig --add storage;
+    chkconfig --level 2345 storage on;
+  when: ansible_os_family == 'RedHat'
   tags:
     - storage
 
index ecd877b..aea955b 100644 (file)
@@ -87,20 +87,20 @@ $SNIPPET('kickstart_pre_anamon')
 %packages --nobase
 @core
 iproute
-ntp
+ntp
 openssh-clients
-wget
-yum-plugin-priorities
+wget
+yum-plugin-priorities
 json-c
 libestr
 rsyslog
 parted
-vim
-lsof
-strace
-#if $os_version == "rhel7"
-net-tools
-#end if
+vim
+lsof
+strace
+# if $os_version == "rhel7"
+net-tools
+# end if
 #if $getVar('tool', '') != ''
     #set $kickstart_software = "kickstart_software_%s" % $tool
 $SNIPPET($kickstart_software)
@@ -118,7 +118,7 @@ chkconfig ip6tables off
 
 $SNIPPET('kickstart_yum')
 $SNIPPET('kickstart_ssh')
-$SNIPPET('kickstart_ntp')
+$SNIPPET('kickstart_ntp')
 $SNIPPET('kickstart_limits.conf')
 $SNIPPET('kickstart_sysctl.conf')
 $SNIPPET('kickstart_rsyslog.conf')
index 699e830..d1dec7b 100644 (file)
@@ -76,7 +76,7 @@ cat << EOF > /etc/init.d/set_state
 #
 #end raw
 
-wget -O /tmp/os_state --post-data='{"ready": true}' --header=Content-Type:application/json "http://$srv/api/hosts/${hostname}/state_internal"
+curl -H "Content-Type: application/json" -X POST -d '{"ready": true}' "http://$srv/api/hosts/${hostname}/state_internal"
 chkconfig set_state off
 mv /etc/init.d/set_state /tmp/set_state
 EOF
index dfc8f1a..0e90e7b 100755 (executable)
@@ -3,5 +3,5 @@ DISPLAY_NAME = 'Openstack Newton'
 PARENT = 'openstack'
 PACKAGE_INSTALLER = 'ansible_installer_newton'
 OS_INSTALLER = 'cobbler'
-SUPPORTED_OS_PATTERNS = ['(?i)ubuntu-16\.04', '(?i)CentOS-7.*15.*']
+SUPPORTED_OS_PATTERNS = ['(?i)ubuntu-16\.04', '(?i)CentOS-7.*16.*']
 DEPLOYABLE = True
diff --git a/deploy/compass_conf/os/centos7.3.conf b/deploy/compass_conf/os/centos7.3.conf
new file mode 100755 (executable)
index 0000000..f814f44
--- /dev/null
@@ -0,0 +1,3 @@
+NAME = 'CentOS-7-Minimal-1611-x86_64'
+PARENT = 'CentOS'
+DEPLOYABLE = True
diff --git a/deploy/compass_conf/templates/cobbler/CentOS-7-Minimal-1611-x86_64/profile.tmpl b/deploy/compass_conf/templates/cobbler/CentOS-7-Minimal-1611-x86_64/profile.tmpl
new file mode 100755 (executable)
index 0000000..cfa8900
--- /dev/null
@@ -0,0 +1,3 @@
+{
+    "repos": "$getVar('repo_name', '')"
+}
diff --git a/deploy/compass_conf/templates/cobbler/CentOS-7-Minimal-1611-x86_64/system.tmpl b/deploy/compass_conf/templates/cobbler/CentOS-7-Minimal-1611-x86_64/system.tmpl
new file mode 100755 (executable)
index 0000000..8e4cbbb
--- /dev/null
@@ -0,0 +1,76 @@
+{
+    "name": "$hostname",
+    "hostname": "$hostname",
+    "profile": "$profile",
+    "gateway": "$gateway",
+    #import simplejson as json
+    #set nameservers = json.dumps($nameservers, encoding='utf-8')
+    "name_servers": $nameservers,
+    #set search_path = ' '.join($search_path)
+    "name_servers_search": "$search_path",
+    "proxy": "$getVar('http_proxy', '')",
+    "modify_interface":
+        #set networks = $networks
+        #set rekeyed = {}
+        #set promic_nic = ""
+        #for $nic, $val in $networks.iteritems():
+            #set ip_key = '-'.join(('ipaddress', $nic))
+            #set netmask_key = '-'.join(('netmask', $nic))
+            #set mgmt_key = '-'.join(('management', $nic))
+            #set static_key = '-'.join(('static', $nic))
+            #set $rekeyed[$ip_key] = $val.ip
+            #set $rekeyed[$netmask_key] = $val.netmask
+            #set $rekeyed[$mgmt_key] = $val.is_mgmt
+            #set $rekeyed[$static_key] = True
+
+            #set dns_key = '-'.join(('dnsname', $nic))
+            #if $val.is_mgmt
+                #set $rekeyed[$dns_key] = $dns
+            #else
+                #if '.' in $dns
+                    #set $dns_name, $dns_domain = $dns.split('.', 1)
+                    #set $dns_nic = '%s-%s.%s' % ($dns_name, $nic, $dns_domain)
+                #else
+                    #set $dns_nic = '%s-%s' % ($dns, $nic)
+                #end if
+                #set $rekeyed[$dns_key] = $dns_nic
+            #end if
+
+            #if $val.is_promiscuous:
+                #set promic_nic = $nic
+            #end if
+            #if $val.is_mgmt:
+                #set mac_key = '-'.join(('macaddress', $nic))
+                #set $rekeyed[$mac_key] = $mac
+            #end if
+        #end for
+        #set nic_info = json.dumps($rekeyed, encoding='utf-8')
+        $nic_info
+    ,
+    "ksmeta":{
+        #set partition_config = ''
+        #for k, v in $partition.iteritems():
+            #set path = ''
+            #if v['vol_percentage']:
+                #set $path = k + ' ' + str(v['vol_percentage']) + '%'
+            #else:
+                #set $path = k + ' ' + str(v['vol_size'])
+            #end if
+            #set partition_config = ';'.join((partition_config, $path))
+        #end for
+        #set partition_config = partition_config[1:]
+        #import crypt
+        #set $password = crypt.crypt($server_credentials.password, "az")
+        #set no_proxy = ','.join($getVar('no_proxy', []))
+        "username": "$server_credentials.username",
+        "password": "$password",
+        "promisc_nics": "$promic_nic",
+        "partition": "$partition_config",
+        "https_proxy": "$getVar('https_proxy', '')",
+        "ntp_server": "$ntp_server",
+        "timezone": "$timezone",
+        "ignore_proxy": "$no_proxy",
+        "local_repo": "$getVar('local_repo', '')",
+        "disk_num": "1"
+    }
+}
index ad21dcd..e0c5655 100644 (file)
@@ -5,7 +5,7 @@ export OS_VERSION=${OS_VERSION:-"xenial"}
 if [ $OS_VERSION = 'xenial' ]; then
     export ADAPTER_OS_PATTERN=${ADAPTER_OS_PATTERN:-'(?i)ubuntu-16\.04'}
 else
-    export ADAPTER_OS_PATTERN=${ADAPTER_OS_PATTERN:-'(?i)CentOS-7.*15.*'}
+    export ADAPTER_OS_PATTERN=${ADAPTER_OS_PATTERN:-'(?i)CentOS-7.*16.*'}
 fi
 
 # newton
@@ -14,7 +14,12 @@ export OPENSTACK_VERSION=${OPENSTACK_VERSION:-"newton"}
 # don't touch this
 export ADAPTER_TARGET_SYSTEM_PATTERN="^openstack$"
 
-export REPO_NAME="$OS_VERSION-$OPENSTACK_VERSION-ppa"
+if [ $OS_VERSION = 'centos7' ]; then
+    unset REPO_NAME
+else
+    export REPO_NAME="$OS_VERSION-$OPENSTACK_VERSION-ppa"
+fi
+
 export ADAPTER_NAME="openstack_$OPENSTACK_VERSION"
 export ADAPTER_FLAVOR_PATTERN="HA-ansible-multinodes-$OPENSTACK_VERSION"
 
diff --git a/repo/openstack/make_ppa/centos/rhel7/newton/download_pkg.tmpl b/repo/openstack/make_ppa/centos/rhel7/newton/download_pkg.tmpl
new file mode 100644 (file)
index 0000000..cbeb1dc
--- /dev/null
@@ -0,0 +1,119 @@
+#!/bin/bash
+set -x
+
+#set OPV="newton"
+
+yum remove systemd -y
+# add 163 repo
+#rm -f /etc/yum.repos.d/CentOS-*.repo
+yum repolist
+yum clean all
+
+yum install yum-plugin-priorities -y
+# yum install http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-6.noarch.rpm -y
+# yum install http://rdo.fedorapeople.org/openstack-$OPV/rdo-release-${OPV}.rpm -y
+yum install -y centos-release-openstack-${OPV}
+
+# modify centos7 repo for workaround
+# sed -i 's/epel-Derived from Red Hat Enterprise Linux 7.1 (Source)/epel-7/g' /etc/yum.repos.d/rdo-release.repo
+
+# add mongodb repo
+cat <<EOF >/etc/yum.repos.d/mongodb.repo
+[mongodb]
+name=MongoDB Repository
+baseurl=http://downloads-distro.mongodb.org/repo/redhat/os/x86_64/
+gpgcheck=0
+enabled=1
+EOF
+
+# add galeracluster repo
+cat <<EOF >/etc/yum.repos.d/MariaDB.repo
+[mariadb]
+name =MariaDB
+baseurl = http://yum.mariadb.org/5.5/centos7-amd64
+gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
+gpgcheck=1
+EOF
+
+cat <<EOF >/etc/yum.repos.d/syslog.repo
+[rsyslog_v7]
+name=rsyslog
+baseurl="http://rpms.adiscon.com/v7-stable/epel-7/x86_64"
+enabled=1
+gpgcheck=0
+gpgkey=http://rpms.adiscon.com/RPM-GPG-KEY-Adiscon
+protect=1
+EOF
+
+rm -rf /etc/yum.repos.d/CentOS-Ceph-Jewel.repo
+#raw
+cat <<EOF >>/etc/yum.repos.d/CentOS-Ceph-Hammer.repo
+# CentOS-Ceph-Hammer.repo
+#
+# Please see http://wiki.centos.org/SpecialInterestGroup/Storage for more
+# information
+
+[centos-ceph-hammer]
+name=CentOS-\$releasever - Ceph Hammer
+baseurl=http://mirror.centos.org/centos/\$releasever/storage/\$basearch/ceph-hammer/
+gpgcheck=1
+enabled=1
+gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-Storage
+
+[centos-ceph-hammer-test]
+name=CentOS-\$releasever - Ceph Hammer Testing
+baseurl=http://buildlogs.centos.org/centos/\$releasever/storage/\$basearch/ceph-hammer/
+gpgcheck=0
+enabled=0
+gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-Storage
+
+[centos-ceph-hammer-debuginfo]
+name=CentOS-\$releasever - Ceph Hammer DebugInfo
+baseurl=http://debuginfo.centos.org/centos/\$releasever/storage/\$basearch/
+gpgcheck=1
+enabled=0
+gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-Storage
+
+[centos-ceph-hammer-source]
+name=CentOS-\$releasever - Ceph Hammer Source
+baseurl=http://vault.centos.org/centos/\$releasever/storage/Source/ceph-hammer/
+gpgcheck=1
+enabled=0
+gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-Storage
+EOF
+#end raw
+
+cat <<EOF >>/etc/yum.conf
+exclude=mongodb-org,mongodb-org-server
+EOF
+
+yum update -y
+yum install createrepo tar -y
+rpm --import 'https://download.ceph.com/keys/release.asc'
+
+yum -y install --downloadonly MariaDB-Galera-server
+#download packages
+#set packages = $getVar('default_packages', [])
+yum -y install --skip-broken --downloadonly #echo ' '.join(packages)
+#set packages = $getVar('packages', [])
+#silent packages.pop(packages.index('MariaDB-Galera-server'))
+yum -y install --skip-broken --downloadonly #echo ' '.join(packages)
+
+#make repo
+mkdir -p /centos7-$OPV-ppa/{Packages,repodata}
+
+find /var/cache/yum/ -name "*.rpm" | xargs -i cp {} /centos7-$OPV-ppa/Packages/
+
+rm /centos7-$OPV-ppa/Packages/selinux-policy* -f
+rm /centos7-$OPV-ppa/Packages/systemd* -f
+
+mv /epel-release-7-5.noarch.rpm /centos7-$OPV-ppa/Packages/
+cp /comps.xml /centos7-$OPV-ppa/
+cp /ceph_key_release.asc /centos7-$OPV-ppa/
+createrepo -g comps.xml /centos7-$OPV-ppa
+mkdir /centos7-$OPV-ppa/noarch
+mkdir /centos7-$OPV-ppa/noarch/Packages
+cp -r /centos7-$OPV-ppa/Packages/ceph* /centos7-$OPV-ppa/noarch/Packages/
+cp -r /centos7-$OPV-ppa/repodata/ /centos7-$OPV-ppa/noarch/
+tar -zcvf /centos7-$OPV-ppa.tar.gz /centos7-$OPV-ppa
+
index d3ce201..72c653e 100755 (executable)
@@ -385,6 +385,11 @@ function make_osppa()
     make_repo --os-ver xenial --package-tag newton \
               --ansible-dir $COMPASS_PATH/deploy/adapters/ansible \
               --default-package "openssh-server"
+
+    make_repo --os-ver rhel7 --package-tag newton \
+              --ansible-dir $COMPASS_PATH/deploy/adapters/ansible \
+              --default-package "rsyslog-7.6.7-1.el7 strace net-tools wget vim openssh-server \
+                                 dracut-config-rescue-033-241.el7_1.5 dracut-network-033-241.el7_1.5"
 }
 
 function make_compass_repo()