centos7源码安装cloud-init
- <template>
- <name>centos72-source</name>
- <os>
- <name>CentOS-7</name>
- <version>2</version>
- <arch>x86_64</arch>
- <install type='iso'>
- <iso>file:///data/md0/iso/CentOS-7.2-x86_64-Minimal-1511.iso</iso>
- </install>
- <rootpw>Ct@2017Yun!@$%.CN</rootpw>
- </os>
- <disk>
- <size>20</size>
- </disk>
- <description>CentOS 7.2 x86_64</description>
- <packages>
- <package name='net-tools'/>
- <package name='acpid'/>
- <package name='cloud-utils-growpart'/>
- <package name='sysstat'/>
- </packages>
- <commands>
- <command name='install_qga'>
- cd /root
- tar xf qga.20171124.tar.gz
- cd qga
- bash ./install_qga_local.sh
- </command>
- <command name='sed_profile'>
- echo "NOZEROCONF=yes" >> /etc/sysconfig/network
- rm -rf /etc/udev/rules.d/70-persistent-net.rules
- touch /etc/udev/rules.d/75-persistent-net-generator.rules
- chmod +x /var/lib/cloud/scripts/per-boot/resetroot
- chmod +x /var/lib/cloud/scripts/per-instance/ssh.sh
- chmod +x /usr/local/bin/nic_set_mq.sh
- echo "/usr/local/bin/nic_set_mq.sh > /tmp/nic_set_mq.log 2>&1" >> /etc/rc.d/rc.local
- chmod +x /etc/rc.d/rc.local
- </command>
- <command name='install_Cloudinit_and_dependencies'>
- mkdir -p /root/.pip/
- yum install wget -y
- yum install epel-release -y
- yum clean all
- yum install python-pip -y
- pip install setuptools jinja2 prettytable oauthlib pyyaml requests jsonpatch jsonschema six --upgrade
- cd /root
- wget https://launchpad.net/cloud-init/trunk/17.1/+download/cloud-init-17.1.tar.gz
- tar -zxvf cloud-init-17.1.tar.gz
- cd ./cloud-init-17.1
- python setup.py build
- python setup.py install --init-system systemd
- </command>
- <command name='console'>
- grub2-mkconfig -o /boot/grub2/grub.cfg
- </command>
- <command name='services'>
- systemctl enable sshd
- systemctl disable firewalld
- systemctl enable cloud-init
- systemctl enable cloud-config
- systemctl enable cloud-final
- systemctl enable cloud-init-local
- systemctl enable acpid
- systemctl disable NetworkManager
- </command>
- <command name='clear-logs'>
- rm -rf /root/*
- rm -rf /var/log/anaconda*
- rm -rf /var/log/message
- >/var/log/boot.log
- >/var/log/messages
- >/var/log/cloud-init-output.log
- >/var/log/yum.log
- >/var/log/lastlog
- </command>
- </commands>
- <files>
- <file name="/root/qga.20171124.tar.gz" type="url">
- file:///data/nvme0n1/OZ-build-image/scripts/qga.20171124.tar.gz
- </file>
- <file name="/var/lib/cloud/scripts/per-boot/resetroot" type="url">
- file:///data/nvme0n1/OZ-build-image/scripts/resetroot
- </file>
- <file name="/etc/cloud/cloud.cfg" type="url">
- file:///data/nvme0n1/OZ-build-image/scripts/cloud.cfg_centos7
- </file>
- <file name="/usr/local/bin/nic_set_mq.sh" type="url">
- file:///data/nvme0n1/OZ-build-image/scripts/nic_set_mq.sh
- </file>
- <file name="/etc/default/grub" type="url">
- file:///data/nvme0n1/OZ-build-image/scripts/grub_centos7
- </file>
- <file name="/var/lib/cloud/scripts/per-instance/ssh.sh" type="url">
- file:///data/nvme0n1/OZ-build-image/scripts/ssh-centos7.ssh
- </file>
- <file name="/root/.pip/pip.conf" type="url">
- file:///data/nvme0n1/OZ-build-image/scripts/pip.conf
- </file>
- <file name="/lib/systemd/system/cloud-init-local.service" type="url">
- file:///data/nvme0n1/OZ-build-image/scripts/cloud-init-local.service
- </file>
- <file name="/lib/systemd/system/cloud-init.service" type="url">
- file:///data/nvme0n1/OZ-build-image/scripts/cloud-init.service
- </file>
- </files>
- </template>
- install
- text
- keyboard us
- lang en_US.UTF-8
- skipx
- network --device eth0 --bootproto dhcp --onboot=on
- rootpw Ct@2017Yun!@$%.CN
- firewall --disabled
- authconfig --enableshadow --enablemd5
- timezone --utc Asia/Shanghai
- selinux --disabled
- zerombr
- clearpart --all --drives=vda
- bootloader --location=mbr --append="console=tty0 console=ttyS0,115200n8"
- part / --fstype xfs --size=2048 --grow --ondisk=vda
- reboot
- %post
- cat <<EOL >> /etc/rc.local
- if [ ! -d /root/.ssh ] ; then
- mkdir -p /root/.ssh
- chmod 0700 /root/.ssh
- restorecon /root/.ssh
- fi
- EOL
- echo "ttyS0" >> /etc/securetty
- cat <<EOF > /etc/init/ttyS0.conf
- start on stopped rc RUNLEVEL=[2345]
- stop on starting runlevel [016]
- respawn
- instance /dev/ttyS0
- exec /sbin/agetty /dev/ttyS0 115200 vt100-nav
- EOF
- %end
- %packages --nobase --excludedocs
- %end
centos7源码安装cloud-init的更多相关文章
- centos7源码安装Python3的前提条件
centos7源码安装Python3的前提条件: # yum -y install openssl-devel bzip2-devel expat-devel gdbm-devel readline- ...
- centos7源码安装mysql5.7.19
centos7源码包安装mysql5.7 5.7.20安装方法和5.7.19的一样. 1.安装前准备 清空环境.安装相应的软件包 1>关闭防火墙和SELinux 2>配置yum源(阿里云, ...
- Centos7源码安装mysql及读写分离,互为主从
Linux服务器 -源码安装mysql 及读写分离,互为主从 一.环境介绍: Linux版本: CentOS 7 64位 mysq版本: mysql-5.6.26 这是我安装时所使用的版本, ...
- CentOS7 源码安装 PostgreSQL 12
PostgreSQL 12 源码安装 Table of Contents 1. 下载 2. 准备环境 3. 编译安装 4. 设置环境变量 5. 初始化数据库 6. 配置参数文件 6.1. postgr ...
- Centos7源码安装Apache和PHP
源码安装Apache 安装需要的依赖 yum -y install gcc autoconf automake make pcre pcre-devel openssl openssl-devel# ...
- centos7源码安装Apache及Tomcat
源码安装Apache (1) 一.通过 https://apr.apache.org/ 下载 APR 和 APR-util 通过 http://httpd.apache.org/download.c ...
- CentOS7源码安装qbittorrent最新版本
CentOS的软件 yum 里 yum search qbittorrent yum info qbittorrent 找到的是3.37版本 官网最新的是4.12版本.但需要源码安装: 官网下载最新版 ...
- CentOS7源码安装Redis5.0.4非关系型数据库
源码安装redis-5.0.4 一. 下载redis 1. 需要连接网络 二. 案例(另一种安装方法) [root@localhost ~]# wget http://download.redis.i ...
- centos7 源码安装goaccess
1. 使用yum安装在不同服务器上可能失败, 推荐使用源码安装goaccess # 安装依赖 yum install -y ncurses-devel GeoIP-devel.x86_64 tokyo ...
- centos7 源码安装指定版本的php7
很多时候可能会遇到需要手动源码安装软件的时候,所以自己实践了一把,并且把安装过程中遇到的问题,以及在网上找到的解决办法(实测有效)都记录下来,方便日后学习实践. 1. 系统环境 # cat /etc/ ...
随机推荐
- CGAL 4.6 - Surface Reconstruction from Point Sets
http://doc.cgal.org/latest/Surface_reconstruction_points_3/ The following example reads a point set, ...
- python 并发编程之协程
一.协程 协程: 单线程下的并发,又称 微线程.协程是一种用户态的的轻量级线程,即协程是由用户程序自己控制调度的. 协程的本质就是在单线程下,由用户自己控制一个任务,遇到 io 阻塞就切换另外一个 ...
- SpringBoot非官方教程 | 第二十三篇: 异步方法
转载请标明出处: 原文首发于https://www.fangzhipeng.com/springboot/2017/07/11/springboot-ansy/ 本文出自方志朋的博客 这篇文章主要介绍 ...
- Unity 游戏框架搭建 (八) 减少加班利器-QLog
为毛要实现这个工具? 在我小时候,每当游戏到了测试阶段,交给QA测试,QA测试了一会儿拿着设备过来说游戏闪退了....当我拿到设备后测了好久Bug也没有复现,排查了好久也没有头绪,就算接了Bugly拿 ...
- NSString+JSON - iOS
日常开发中常用的一个相互转换的方法; 直接创建对应的类,引用如下方法即可实现; 具体 code 如下: 声明: #import <Foundation/Foundation.h> @int ...
- (eclipse)统一文件编码和代码风格
前言 1>每个人的代码风格不一样,以至于代码各式各样,有习惯=号左右加空格的,有习惯不加的,此举有时还会影响svn提交代码 2>注释代码不一样,并且注释风格也不一样 统一文件编码和代码风格 ...
- [HNOI2003]操作系统(优先队列,堆排序)
题目描述 写一个程序来模拟操作系统的进程调度.假设该系统只有一个CPU,每一个进程的到达时间,执行时间和运行优先级都是已知的.其中运行优先级用自然数表示,数字越大,则优先级越高. 如果一个进程到达的时 ...
- Jmeter的安装教程【图文】
Jmeter是一款开源的测试工具,其安装分为两大部分:JDK和Jmeter 第一部分:安装JDK 第一步: 官网下载JDK,可以按照引用地址jdk下载教程进行下载,下载完毕后,进行安装即可 第二步: ...
- thinkphp 3.2中依靠关联模型来关联三个表
这里说的是用thinkphp3.2关联模型关联三个表 根据用户表查询出三个表的数据,需要两个model来配合,第一个model是根据user表来查询到班级的信息,然后第二个model是根绝banji中 ...
- STM32CubeMx配置正交编码器遇到的问题
配置时参考了这个哥们的方法: http://www.eemaker.com/stm32cubemx-encoder.html 然后我的配置是这样的 配置是没有问题. 调用时出现了问题. 由于配置完了, ...