--- - name: (CentOS/RHEL) Add NGINX Unit repository yum_repository: name: nginx-unit baseurl: "https://packages.nginx.org/unit/{{ (ansible_facts['distribution'] == 'RedHat') | ternary('rhel/', 'centos/') }}$releasever/$basearch/" description: NGINX Unit Repository enabled: yes gpgcheck: yes mode: 0644 when: ansible_facts['distribution'] != "Amazon" - name: (Amazon Linux) Add NGINX Unit repository yum_repository: name: nginx-unit baseurl: "https://packages.nginx.org/unit/amzn\ {{ (ansible_facts['distribution_major_version'] is version('2', '==')) | ternary('2', '') }}/$releasever/$basearch/" description: NGINX Unit Repository enabled: yes gpgcheck: yes mode: 0644 when: ansible_facts['distribution'] == "Amazon"