added ansible user

This commit is contained in:
Shankar Mounesh
2022-06-12 18:25:55 +05:30
parent f9136415a7
commit 9ff48de7fc
4 changed files with 19 additions and 12 deletions
+1 -4
View File
@@ -13,10 +13,7 @@ The above command downloads a bash file from 172.16.16.65 and runs the following
```sh
apt update -y;
apt install git -y;
apt install software-properties-common -y;
add-apt-repository --yes --update ppa:ansible/ansible;
apt install ansible -y;
apt install git ansible -y;
ansible --version;
ansible-pull -U https://git.bitsathy.ac.in/ShankarMounesh/ansible-proxmox.git
```
+1
View File
@@ -7,4 +7,5 @@ deb http://security.debian.org/debian-security bullseye-security main contrib
# PVE pve-no-subscription repository provided by proxmox.com,
# NOT recommended for production use
deb http://download.proxmox.com/debian/pve bullseye pve-no-subscription
+1
View File
@@ -0,0 +1 @@
ansible ALL=(ALL) NOPASSWD: ALL
+16 -8
View File
@@ -20,11 +20,6 @@
owner: root
group: root
# - name: Remove ansible repo
# community.general.apt_repo:
# repo: ansible/ansible
# state: absent
tasks:
- name: update package cache
@@ -33,6 +28,19 @@
- name: dist upgrade
apt: upgrade=dist
- name: Unconditionally reboot the machine with all defaults
reboot:
reboot_command: reboot
- name: adding a user for ansible cron job
user:
name: ansible
system: yes
- name: setup sudo for ansible user
copy:
src: files/sudoer_ansible
dest: /etc/sudoers.d/ansible
owner: root
group: root
mode: 0440
- name: reboot the machine
ansible.builtin.shell: reboot