Set become_method in ansible.cfg

This commit is contained in:
Timotej Lazar 2024-06-20 20:47:00 +02:00
parent 2618c1c414
commit dbdf88fe36
5 changed files with 3 additions and 10 deletions

View file

@ -2,3 +2,6 @@
nocows = true
inventory = inventory.yml
remote_user = root
[privilege_escalation]
become_method = su

View file

@ -59,7 +59,6 @@
- name: Set up authentication
become: yes
become_method: su
become_user: forgejo
block:
- name: Get passwords
@ -136,14 +135,12 @@
block:
- name: Get runner token
become: yes
become_method: su
become_user: forgejo
command: forgejo actions generate-runner-token
register: token
- name: Register runner
become: yes
become_method: su
become_user: forgejo-runner
become_flags: '-s /bin/sh -l'
command: |

View file

@ -20,7 +20,6 @@
- name: run migrations
become: yes
become_method: su
become_user: '{{ user }}'
command: sh ~/app/upgrade.sh
notify: restart netbox

View file

@ -12,7 +12,6 @@
- name: Checkout repo
become: yes
become_method: su
become_user: '{{ user }}'
git:
repo: https://github.com/netbox-community/netbox.git
@ -83,7 +82,6 @@
- name: Set additional requirements
become: yes
become_method: su
become_user: '{{ user }}'
copy:
dest: '{{ user_info.home }}/app/'
@ -94,7 +92,6 @@
- name: Create superuser
become: yes
become_method: su
become_user: '{{ user }}'
command:
cmd: '{{ user_info.home }}/app/venv/bin/python {{ user_info.home }}/app/netbox/manage.py shell --interface python'

View file

@ -13,7 +13,6 @@
- name: Check for existing database password
become: yes
become_user: '{{ user }}'
become_method: su
slurp:
path: '~/.pgpass'
register: pgpass
@ -30,7 +29,6 @@
- name: Create .pgpass
become: yes
become_user: '{{ user }}'
become_method: su
copy:
dest: '~/.pgpass'
content: |
@ -39,7 +37,6 @@
mode: 0600
- become: yes
become_method: su
become_user: postgres
block:
- name: Create database