ansibleのyamlでnginxのインストールを行いたいのですがエラーが出ます。
エラーの発生したyamlの内容を置きますので解消法教えていただけますと幸いです。
main.yml
- name: nginx install
shell:yum install nginx
args:
warn: no
エラー
fatal: [Client01]: FAILED! => {
"changed": true,
"cmd": "yum -y install nginx",
"delta": "0:00:00.651993",
"end": "2020-09-05 13:06:43.982719",
"msg": "non-zero return code",
"rc": 1,
"start": "2020-09-05 13:06:43.330726",
"stderr": "Error: Nothing to do",
"stderr_lines": [
"Error: Nothing to do"
],
"stdout": "Loaded plugins: extras_suggestions, langpacks, priorities, update-motd\nNo package nginx available.\n\n\nnginx is available in Amazon Linux Extra topics \"nginx1.12\" and \"nginx1\"\n\nTo use, run\n# sudo amazon-linux-extras install :topic:\n\nLearn more at\nhttps://aws.amazon.com/amazon-linux-2/faqs/#Amazon_Linux_Extras",
"stdout_lines": [
"Loaded plugins: extras_suggestions, langpacks, priorities, update-motd",
"No package nginx available.",
"",
"",
"nginx is available in Amazon Linux Extra topics \"nginx1.12\" and \"nginx1\"",
"",
"To use, run",
"# sudo amazon-linux-extras install :topic:",
"",
"Learn more at",
"https://aws.amazon.com/amazon-linux-2/faqs/#Amazon_Linux_Extras"
]
}
他にも以下のようなインストールの方法を試しましたがエラーが出てインストール出来ません。
- name: nginx install
yum:
name: nginx
state: latest
- name: install nginx
package:
name: nginx
state: present