diff --git a/lemp-rhel7/roles/common/tasks/main.yml b/lemp-rhel7/roles/common/tasks/main.yml index 3b47304..cd8e56a 100644 --- a/lemp-rhel7/roles/common/tasks/main.yml +++ b/lemp-rhel7/roles/common/tasks/main.yml @@ -1,18 +1,6 @@ --- -- name: Copy the NGINX repository definition - copy: src=nginx.repo dest=/etc/yum.repos.d/ - -- name: Copy the EPEL repository definition - copy: src=epel.repo dest=/etc/yum.repos.d/ - -- name: Create the GPG key for NGINX - copy: src=RPM-GPG-KEY-NGINX dest=/etc/pki/rpm-gpg - -- name: Create the GPG key for EPEL - copy: src=RPM-GPG-KEY-EPEL-7 dest=/etc/pki/rpm-gpg - -- name: Creates custom users - user: name=vmuser comment=DefaultUser groups=vmuser,wheel password={{ default_user_password }} shell=/bin/bash createhome=yes - user: name=www-php comment=DefaultPHPUser shell=/sbin/nologin createhome=no +# Setup/install tasks. +- include: setup-RedHat.yml + when: ansible_os_family == 'RedHat' - hostname: name={{ server_hostname }} diff --git a/lemp-rhel7/roles/common/tasks/setup-RedHat.yml b/lemp-rhel7/roles/common/tasks/setup-RedHat.yml new file mode 100644 index 0000000..e36051e --- /dev/null +++ b/lemp-rhel7/roles/common/tasks/setup-RedHat.yml @@ -0,0 +1,15 @@ +- name: Copy the NGINX repository definition + copy: src=nginx.repo dest=/etc/yum.repos.d/ + +- name: Copy the EPEL repository definition + copy: src=epel.repo dest=/etc/yum.repos.d/ + +- name: Create the GPG key for NGINX + copy: src=RPM-GPG-KEY-NGINX dest=/etc/pki/rpm-gpg + +- name: Create the GPG key for EPEL + copy: src=RPM-GPG-KEY-EPEL-7 dest=/etc/pki/rpm-gpg + +- name: Creates custom users + user: name=vmuser comment=DefaultUser groups=vmuser,wheel password={{ default_user_password }} shell=/bin/bash createhome=yes + user: name=www-php comment=DefaultPHPUser shell=/sbin/nologin createhome=no