added ansible user
This commit is contained in:
@@ -13,10 +13,7 @@ The above command downloads a bash file from 172.16.16.65 and runs the following
|
|||||||
|
|
||||||
```sh
|
```sh
|
||||||
apt update -y;
|
apt update -y;
|
||||||
apt install git -y;
|
apt install git ansible -y;
|
||||||
apt install software-properties-common -y;
|
|
||||||
add-apt-repository --yes --update ppa:ansible/ansible;
|
|
||||||
apt install ansible -y;
|
|
||||||
ansible --version;
|
ansible --version;
|
||||||
ansible-pull -U https://git.bitsathy.ac.in/ShankarMounesh/ansible-proxmox.git
|
ansible-pull -U https://git.bitsathy.ac.in/ShankarMounesh/ansible-proxmox.git
|
||||||
```
|
```
|
||||||
|
|||||||
@@ -7,4 +7,5 @@ deb http://security.debian.org/debian-security bullseye-security main contrib
|
|||||||
|
|
||||||
# PVE pve-no-subscription repository provided by proxmox.com,
|
# PVE pve-no-subscription repository provided by proxmox.com,
|
||||||
# NOT recommended for production use
|
# NOT recommended for production use
|
||||||
|
|
||||||
deb http://download.proxmox.com/debian/pve bullseye pve-no-subscription
|
deb http://download.proxmox.com/debian/pve bullseye pve-no-subscription
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
ansible ALL=(ALL) NOPASSWD: ALL
|
||||||
+16
-8
@@ -20,11 +20,6 @@
|
|||||||
owner: root
|
owner: root
|
||||||
group: root
|
group: root
|
||||||
|
|
||||||
# - name: Remove ansible repo
|
|
||||||
# community.general.apt_repo:
|
|
||||||
# repo: ansible/ansible
|
|
||||||
# state: absent
|
|
||||||
|
|
||||||
tasks:
|
tasks:
|
||||||
|
|
||||||
- name: update package cache
|
- name: update package cache
|
||||||
@@ -33,6 +28,19 @@
|
|||||||
- name: dist upgrade
|
- name: dist upgrade
|
||||||
apt: upgrade=dist
|
apt: upgrade=dist
|
||||||
|
|
||||||
- name: Unconditionally reboot the machine with all defaults
|
- name: adding a user for ansible cron job
|
||||||
reboot:
|
user:
|
||||||
reboot_command: reboot
|
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
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user