Getting Started with Ansible

Why Ansible?

If you have tens, hundreds or thousands of servers, you will need a solution like Ansible or Puppet. These products allow you to define how each server is configured in declarative languages and they can control thousands of servers.

Starting with Ansible

I provisioned an ARM64 host for Ansible yesterday. I wrote an article that explains how to install Ansible on it here. Now I want to test it.

So the Ansible host has to know about Jenkins host. I have added the following lines in /etc/ansible/hosts file.


The hosts file can have IP address or FQDN, so I added the FQDN on OCI.

Now I should be able to ssh into the Jenkins host from Ansible host, so I added the public key of Ansible to Jenkins’ authorized_keys. Now I can ssh into the Jenkins host from the Ansible host.

On the Ansible host, test the configuration.

ansible-3 all -m ping

Output: | SUCCESS => {
    "ansible_facts": {
        "discovered_interpreter_python": "/usr/bin/python"
    "changed": false,
    "ping": "pong"

Test running a command on the client host.

ansible all -a "/bin/echo hello"

Output: | CHANGED | rc=0 >>

Creating a Playbook

I am creating the following file jenkins_playbook.yaml with the content below.

- name: Jenkins Playbook
  hosts: all
    - name: Create a file
      shell: |
       echo 'hoge hoge hoge' >> ~/test.txt

Execute the playbook.

ansible-playbook-3 jenkins_playbook.yaml


PLAY [Jenkins Playbook] **************************************************************************************************************************

TASK [Gathering Facts] ***************************************************************************************************************************
[WARNING]: Platform linux on host is using the discovered Python interpreter at /usr/bin/python, but future
installation of another Python interpreter could change this. See for more information.
ok: []

TASK [Create a file] *****************************************************************************************************************************
changed: []

PLAY RECAP *************************************************************************************************************************************** : ok=2    changed=1    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0

We’ll ignore the warning for now. Now I am going to ssh into the Jenkins host and check the ~/test.txt file.

[opc@jenkins ~]$ cat test.txt
hoge hoge hoge

This concludes the very basics of how Ansible works. I am planning to dig into it more as I have time during the end of year holidays.

How to List Listening Ports on Linux

When you start daemons or Docker containers that listen to certain ports, you want to make sure they are actually listening. You can use netstat to list listening ports.

netstat -tulpn

As you can see, we can’t tell the process or process ID for each port. If you just add sudo, you can see the process information.

This is an essential tool when you diagnose what’s going on on the host where you want to host daemons/services.

2021 at a Glance

I have been blogging since June 2018. This year has been rocky in my personal life (health wise) but I accomplished something great in this space. I have taken full control over my blog engine and DNS by moving my domain name to DNSimple and by provisioning WordPress engine on Docker on OCI. That was some struggle but it was totally worth it for me because I’ve got to learn so much from it.

After all I am a software engineer and I should be able to do it but if you don’t try to dig into it, I would never have accomplished it. This blog is hosted in OCI where the ARM64 host is free of charge, so I am only spending the money for the DNSimple service which is about $60 annually. $60 for your own domain and a free hosting for your blog site is totally worth it if you don’t mind spending some hours to get it up and running.

My passion is in automation, so I will blog my findings in that area in the next year or whatever is related to software engineering. This is my space after all. Thank you for the all visitors and the ones who left comments in this site.

I look forward to interacting with more people next year.

How to Install Ansible on Oracle Linux 7 on ARM64

I’m wanting to learn Ansible and I would like to get my hands on it, so I am installing Ansible on an ARM64 host on Oracle Cloud Infrastructure.

  • Install Epel Release.
    sudo yum-config-manager --enable ol7_developer_EPEL
  • Install Ansible.
    sudo yum install ansible-python3
  • Check the installation.
    ansible-playbook-3 --version

It worked on Oracle Linux 7 on ARM64. I will blog more about how Ansible works in the coming days.

Migrated to ARM64 Oracle Linux 7

I have migrated my site to Oracle Linux 7 on ARM64 just because I was curious how it would work on ARM64 or if it would work on ARM64 at all.

As of this writing, I’ve got this WordPress site on Docker to work on Oracle Linux 7 on ARM64 processor. It was some struggle but I feel it’s snappier.

Here is the Docker Compose file that works for this site. As you can see, I commented out the mysql image and using Maria DB for ARM64 instead. Maria DB is a fork for MySQL, so it’s sufficient enough for my personal blog site.

version: "3.9"
    image: arm64v8/mariadb # mysql/mysql-server:8.0.20-aarch64
      - ./mysql:/var/lib/mysql
    restart: always
    command: mysqld --default-authentication-plugin=mysql_native_password
      MYSQL_ROOT_PASSWORD: YourPassword
      MYSQL_DATABASE: hayato_iriumi_db
      MYSQL_USER: blog_admin
      MYSQL_PASSWORD: AnotherPassword
      - db
    image: arm64v8/phpmyadmin
    restart: always
      - '8080:80'
      PMA_HOST: db
      MYSQL_ROOT_PASSWORD: YourPassword
    image: arm64v8/wordpress
    container_name: wordpress
      - db
        # ports:
        # - "8000:80"
    restart: always
      WORDPRESS_DB_HOST: db:3306
      WORDPRESS_DB_USER: blog_admin
      WORDPRESS_DB_PASSWORD: AnotherPassword
      WORDPRESS_DB_NAME: hayato_iriumi_db
      WORDPRESS_DEBUG: 'true'
      - ./html:/var/www/html
      - ./wp-content:/var/www/html/wp-content
    image: arm64v8/nginx
      - ./nginx/nginx.conf:/etc/nginx/nginx.conf
      - ./nginx/conf.d:/etc/nginx/conf.d
      - "80:80"
      - "443:443"
    restart: always
  db_data: {}
  wordpress: {}

Docker Compose 2 works well on ARM64 as well. It is definitely faster than Docker Compose 1. By just changing the platform, I feel I upgraded my blog site for a better performance.

WordPress Site on ARM64 Linux

I struggled with provisioning MySQL 8 Docker container for ARM64 today. I just could not access MySQL instance from MyPHPAdmin. I eventually ended up with provisioning Maria DB for ARM64 and now I am able to access it from MyPHPAdmin.

I will spend my time later to migrate my WordPress to the new instance. I believe it will be snappier when it’s done.

How to Install Docker Compose 2 on ARM Processor Linux Host (OL7)

I have provisioned Oracle Linux 7 on ARM processor on OCI. In an attempt to get my blog site to work on the host, I have installed Docker engine and now I want to install Docker Compose 2. Here are the steps.

  1. Create a directory.
    mkdir -p ~/.docker/cli-plugins/
  2. Download the Docker Compose 2 binary for ARM64.
    curl -SL -o ~/.docker/cli-plugins/docker-compose
  3. Give the binary file execute permission.
    chmod +x ~/.docker/cli-plugins/docker-compose
  4. Check if the binary has been installed successfully.
    docker compose version

Not Working on ARM Host

I spined up an ARM host on OCI and installed Docker Compose 2 and then downloaded my docker-compose.yaml file to start my blog engine on it, but I got the following error.

This means no image is available for ARM64. I don’t think there is anything I can do at the moment (unless I make the effort and create images myself), so I am giving it up for now. Oh well…

Edit: I did some research to see if those Docker images are available and they are. I will give it another try.

log4j Vulnerability

The Internet has been on fire since last Friday. Apache Foundation released an emergency update to address the issue. My company is urgently addressing this issue at the moment as well so that we and our customers won’t get affected by this big security hole.

I read on the Internet that hackers are already trying to exploit it, so whoever uses log4j need to take immediate action on this.