Multi-operating system considerations

Looking at each of the core Ansible modules used in the three roles, stack-install, stack-config, and wordpress, we are using a few that will not work on our newly introduced Ubuntu box. Let's quickly work through each one and see what we need to take into account when targeting two very different operating systems:

  • yum: The yum module is the package manager used for Red Hat-based machines such as CentOS, as Ubuntu is based on Debian, which uses apt. We will need to break out the parts of our playbook that uses the yum module to use the apt module instead.
  • yum_repository: As mentioned, we will need to use an apt equivalent module, which is apt_repository.
  • user: The user module works pretty much the same on both operating systems, as we are not giving our user escalated privileges. There aren't any special considerations we need to make, other than double-checking the correct group is available.
  • template, file, copy, and lineinfile: All four of these modules will work as expected; the only consideration we need to make is checking that we are copying the files to the correct location on the boxes.
  • service: The service module should be the same on both operating systems, so we should be fine.
  • mysql_user and mysql_db: As you would expect, once MySQL is installed and started, both of these will work across both operating systems.
  • selinux_permissive: SELinux is primarily for operating systems based on Red Hat, so we will need to find an alternative.
  • get_url, stat, shell, and set_fact: These should all work consistently across both of our target operating systems.

Now we know which parts of our existing playbook we need to review when running on Ubuntu versus running CentOS, we can make a start on making our roles work on both of the operating systems.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.145.93.221