インフラCIをやりたい-Part2

VMware fusionCentOSを入れて前回のリベンジ
GitとAnsibleを入れた後から

f:id:hedgehogweeklyreport:20181230124132p:plain

構成の整理

要素 構成
ホスト基盤 Mac
ゲスト基盤 VMware Fusion
ゲストOS CentOS 7.4
ゲストCPU 2コア
ゲスト/(root)ストレージ 50GB以上
ゲストメモリ 8GB以上

VM側の設定で[この仮想マシンでハイパーバイザアプリケーションを有効にする]にチェック

f:id:hedgehogweeklyreport:20181230141521p:plain:w300

再度ansible-playbook site.ymlを実行

ansible-playbook site.yml

f:id:hedgehogweeklyreport:20181230141925p:plain

前回コケた[check the virt type]の箇所はクリアしてる!!
だがしかし[/(root)]のディスク領域が十分でないよというエラーを吐かれる…

ギリギリを攻め過ぎたのか必要分は割り当ててる筈けど足りない模様…
もう少し余裕を持たせる形で再インストールする

3度目の正直

ディスク容量に余裕を持たせたVMを立てて再度実行

[root@infraci bootstrap-host]# ansible-playbook site.yml

PLAY [Check available disk space] ******************************************************************

TASK [Gathering Facts] *****************************************************************************
ok: [127.0.0.1]

TASK [diskspace : Check for a supported Operating System] ******************************************
ok: [127.0.0.1] => {
    "changed": false, 
    "msg": "All assertions passed"
}

TASK [diskspace : Get CPU info content and check the virt type] ************************************
ok: [127.0.0.1]

TASK [diskspace : Check the virt type] *************************************************************
ok: [127.0.0.1] => {
    "changed": false, 
    "msg": "All assertions passed"
}

TASK [diskspace : Identify the space available in /] ***********************************************
ok: [127.0.0.1]

TASK [diskspace : Set root disk facts] *************************************************************
ok: [127.0.0.1]

TASK [diskspace : Set min size fact] ***************************************************************
ok: [127.0.0.1]

TASK [diskspace : Fail if there is not enough space available in /] ********************************
ok: [127.0.0.1] => {
    "changed": false, 
    "msg": "All assertions passed"
}

PLAY [Install required packages] *******************************************************************

TASK [Gathering Facts] *****************************************************************************
ok: [127.0.0.1]

TASK [preset : Set ipv6 on in /proc and in the sysctl file and reload if necessary] ****************
changed: [127.0.0.1]

TASK [preset : Check if service exists] ************************************************************
ok: [127.0.0.1]

TASK [preset : Stop and disable firewalld] *********************************************************
changed: [127.0.0.1]

TASK [preset : Install packages] *******************************************************************
changed: [127.0.0.1] => (item=[u'openssh', u'vim'])

TASK [preset : Generate SSH keys] ******************************************************************
changed: [127.0.0.1]

TASK [preset : Put .vimrc to /root] ****************************************************************
changed: [127.0.0.1]

PLAY [Install Virtualbox] **************************************************************************

TASK [virtualbox : Checking VirtualBox is installed or not] ****************************************
fatal: [127.0.0.1]: FAILED! => {"changed": false, "cmd": "which virtualbox", "delta": "0:00:00.003726", "end": "2018-12-31 01:15:36.879595", "msg": "non-zero return code", "rc": 1, "start": "2018-12-31 01:15:36.875869", "stderr": "which: no virtualbox in (/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin)", "stderr_lines": ["which: no virtualbox in (/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin)"], "stdout": "", "stdout_lines": []}
...ignoring

TASK [virtualbox : Add VirtualBox repo file] *******************************************************
changed: [127.0.0.1]

TASK [virtualbox : Cleanup repo caches] ************************************************************
 [WARNING]: Consider using yum module rather than running yum

changed: [127.0.0.1]

TASK [virtualbox : Install dependency packages] ****************************************************
changed: [127.0.0.1] => (item=[u'gcc', u'make', u'kernel-headers'])

TASK [virtualbox : Install additional packages] ****************************************************
changed: [127.0.0.1]

TASK [virtualbox : Install VirtualBox] *************************************************************
changed: [127.0.0.1]

TASK [virtualbox : Initialize VirtualBox] **********************************************************
changed: [127.0.0.1]

PLAY [Install Vagrant] *****************************************************************************

TASK [Gathering Facts] *****************************************************************************
ok: [127.0.0.1]

TASK [vagrant : Ensure temp download directory exist] **********************************************
changed: [127.0.0.1]

TASK [vagrant : Download vagrant] ******************************************************************
changed: [127.0.0.1]

TASK [vagrant : Install list of packages (RHEL/CentOS)] ********************************************
changed: [127.0.0.1] => (item=[u'/tmp/vagrant_downloads/vagrant_2.0.1_x86_64.rpm'])

PLAY [Deploy Vagrantfile] **************************************************************************

TASK [Gathering Facts] *****************************************************************************
ok: [127.0.0.1]

TASK [vagrantfile : Ensure Vagrantfile directory exist] ********************************************
changed: [127.0.0.1]

TASK [vagrantfile : Deploy Vagraltfile] ************************************************************
changed: [127.0.0.1]

PLAY [Manage server instance] **********************************************************************

TASK [instance : vagrant up] ***********************************************************************
changed: [127.0.0.1]

PLAY RECAP *****************************************************************************************
127.0.0.1                  : ok=30   changed=17   unreachable=0    failed=0   

[root@infraci bootstrap-host]# 

f:id:hedgehogweeklyreport:20181231013139p:plain

failed=0で終了!今度こそうまく行った
漸く初期構築が終わり前に進めます
気分良く年を越せそう

おまけ

VirtualBoxでは仮想支援機能というのがあったけど有効化しても上記の[check the virt type]がクリア出来なかったのでVMware fusionに切り替えたという経緯あり

f:id:hedgehogweeklyreport:20181230192657p:plain:w400