2
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

cloud-init で CentOS7 をセットアップする

Last updated at Posted at 2019-10-04

ダウンロード

8GBということがわかる
$ qemu-img info CentOS-7-x86_64-GenericCloud-1907.qcow2 
image: CentOS-7-x86_64-GenericCloud-1907.qcow2
file format: qcow2
virtual size: 8.0G (8589934592 bytes)
disk size: 887M
cluster_size: 65536
Format specific information:
    compat: 0.10
    refcount bits: 16

seed.iso

  • meta-data
meta-data
local-hostname: db1.local

network-interfaces: |
  auto eth0
  iface eth0 inet static
  address 192.168.100.62
  netmask 255.255.255.0
  gateway 192.168.100.1
  dns-nameservers 8.8.8.8 8.8.4.4
  #
  auto eth1
  iface eth1 inet static
  address 10.0.1.62
  netmask 255.255.255.0
  • user-data
user-data
# cloud-config

# user: centos
password: plain-password-1
chpasswd: { expire: False }

ssh_pwauth: True

timezone: Asia/Tokyo
locale: ja_JP.utf8

runcmd:
  # SELinux
  - setenforce 0
  - sed -ie 's/^\SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/config
  - reboot
seed.isoの作成
genisoimage -output seed.iso \
 -volid cidata -joliet -rock \
 user-data meta-data

起動

seed.isoを接続して起動。

スクリーンショット_2019-10-04_12-54-19.png

  • /var/lib/cloud/instance/ 内に、使用された設定ファイルが保存されている。

初期設定

ansible2.8を入れてみる
yum install -y epel-release.noarch
yum install -y ansible.noarch
2
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?