Help us understand the problem. What is going on with this article?

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

ダウンロード

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
Why do not you register as a user and use Qiita more conveniently?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away