diff --git a/inventory.txt b/inventory.txt new file mode 100644 index 0000000..4bf6936 --- /dev/null +++ b/inventory.txt @@ -0,0 +1,2 @@ +[roma01] +127.0.0.1 \ No newline at end of file diff --git a/readme.md b/readme.md new file mode 100644 index 0000000..e4527c9 --- /dev/null +++ b/readme.md @@ -0,0 +1,10 @@ +# 始めに + +## メモ + +- Almalinux 9系のansible 2.14(yumリポジトリはappstream) のansible-core + +## + +ansible-playbook --private-key=.ssh/id_rsa -i inventory.txt roma01.yml + diff --git a/roma01.yml b/roma01.yml new file mode 100644 index 0000000..1679629 --- /dev/null +++ b/roma01.yml @@ -0,0 +1,51 @@ +--- +- name: roma01 + hosts: roma01 + become: true + tasks: + - name: Ping my hosts + ansible.builtin.ping: + - name: Print message + ansible.builtin.debug: + msg: Hello world + - name: Installed epel-release + ansible.builtin.dnf: + name: epel-release + state: present + - name: Installed ansible + ansible.builtin.dnf: + name: ansible-core + state: present + - name: Installed etckeeper + ansible.builtin.dnf: + name: etckeeper + state: present + - name: Basic settings => hostname + ansible.builtin.hostname: + name: roma01 + - name: Basic settings => timezone + community.general.timezone: + name: Asia/Tokyo + - name: Basic setting => language ja-jp.utf8 install requirement + ansible.builtin.dnf: + name: glibc-langpack-ja + state: present + - name: Basic setting => language ja-jp.utf8 check + command: localectl status + register: localectl_result + check_mode: no + changed_when: false + - name: Basic setting => language ja-jp.utf8 change + command: localectl set-locale LANG=ja_JP.utf8 + when: "'LANG=ja_JP.utf8' not in localectl_result.stdout" + - name: Basic setting => install useful packages + ansible.builtin.dnf: + name: + - vim + - bash-completion + - htop + - bind-utils + - git + - lsof + - dnf-automatic + state: present