Ansibleを利用し、CentOS 6とCent OS 7にApacheを導入してみる。 1. playbookを書いてみた。 やりたいことは、 - yumで apacheを導入 - httpdプロセスを起動 - iptablesまたは、firewalldで80portを設定 - iptables/firewalldの変更があれば、プロセス再起動 で、書いてみた内容が以下。 --- - hosts: kobatest tasks: - name: install apache yum: name=httpd - name: CentOS6 start httpd service: name=httpd state=restarted when: (ansible_distribution == "CentOS" and ansible_distribution_major_version