mirror of
https://github.com/freeipa/ansible-freeipa.git
synced 2026-03-26 21:33:05 +00:00
user: Use FQCN for ansible.builtin
Use Fully Qualified Collection Name (FQCN) for ansible builtins. This is ansible.builtin.set_fact instead of set_fact for example and aplies for all actions that are part of ansible.builtin. All the replaced ansible.builtins: assert, command, copy, debug, fail, fetch, file, import_playbook, import_tasks, include_role, include_tasks, include_vars, package, set_fact, shell, slurp, stat, systemd
This commit is contained in:
@@ -15,5 +15,5 @@
|
||||
register: ipauser
|
||||
|
||||
- name: Print generated random password
|
||||
debug:
|
||||
ansible.builtin.debug:
|
||||
var: ipauser.user.randompassword
|
||||
|
||||
@@ -20,9 +20,9 @@
|
||||
register: ipauser
|
||||
|
||||
- name: Print generated random password for user1
|
||||
debug:
|
||||
ansible.builtin.debug:
|
||||
var: ipauser.user.user1.randompassword
|
||||
|
||||
- name: Print generated random password for user2
|
||||
debug:
|
||||
ansible.builtin.debug:
|
||||
var: ipauser.user.user2.randompassword
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
tasks:
|
||||
- name: Generate self-signed certificates.
|
||||
shell:
|
||||
ansible.builtin.shell:
|
||||
cmd: |
|
||||
openssl req -x509 -newkey rsa:2048 -days 365 -nodes -keyout "private{{ item }}.key" -out "cert{{ item }}.pem" -subj '/CN=test'
|
||||
openssl x509 -outform der -in "cert{{ item }}.pem" -out "cert{{ item }}.der"
|
||||
@@ -81,7 +81,7 @@
|
||||
failed_when: not result.changed or result.failed
|
||||
|
||||
- name: Remove certificate files. # noqa: deprecated-command-syntax
|
||||
shell:
|
||||
ansible.builtin.shell:
|
||||
cmd: rm -f "private{{ item }}.key" "cert{{ item }}.pem" "cert{{ item }}.der" "cert{{ item }}.b64"
|
||||
with_items: [1, 2, 3]
|
||||
become: no
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
tasks:
|
||||
- name: Generate self-signed certificates.
|
||||
shell:
|
||||
ansible.builtin.shell:
|
||||
cmd: |
|
||||
openssl req -x509 -newkey rsa:2048 -days 365 -nodes -keyout "private{{ item }}.key" -out "cert{{ item }}.pem" -subj '/CN=test'
|
||||
openssl x509 -outform der -in "cert{{ item }}.pem" -out "cert{{ item }}.der"
|
||||
@@ -94,7 +94,7 @@
|
||||
failed_when: not result.changed or result.failed
|
||||
|
||||
- name: Remove certificate files. # noqa: deprecated-command-syntax
|
||||
shell:
|
||||
ansible.builtin.shell:
|
||||
cmd: rm -f "private{{ item }}.key" "cert{{ item }}.pem" "cert{{ item }}.der" "cert{{ item }}.b64"
|
||||
with_items: [1, 2, 3]
|
||||
become: no
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
tasks:
|
||||
- name: Generate self-signed certificates.
|
||||
shell:
|
||||
ansible.builtin.shell:
|
||||
cmd: |
|
||||
openssl req -x509 -newkey rsa:2048 -days 365 -nodes -keyout "private{{ item }}.key" -out "cert{{ item }}.pem" -subj '/CN=test'
|
||||
openssl x509 -outform der -in "cert{{ item }}.pem" -out "cert{{ item }}.der"
|
||||
@@ -226,7 +226,7 @@
|
||||
failed_when: not result.changed or result.failed
|
||||
|
||||
- name: Remove certificate files. # noqa: deprecated-command-syntax
|
||||
shell:
|
||||
ansible.builtin.shell:
|
||||
cmd: rm -f "private{{ item }}.key" "cert{{ item }}.pem" "cert{{ item }}.der" "cert{{ item }}.b64"
|
||||
with_items: [1, 2, 3]
|
||||
become: no
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
tasks:
|
||||
- name: Generate self-signed certificates.
|
||||
shell:
|
||||
ansible.builtin.shell:
|
||||
cmd: |
|
||||
openssl req -x509 -newkey rsa:2048 -days 365 -nodes -keyout "private{{ item }}.key" -out "cert{{ item }}.pem" -subj '/CN=test'
|
||||
openssl x509 -outform der -in "cert{{ item }}.pem" -out "cert{{ item }}.der"
|
||||
@@ -162,7 +162,7 @@
|
||||
failed_when: not result.changed or result.failed
|
||||
|
||||
- name: Remove certificate files. # noqa: deprecated-command-syntax
|
||||
shell:
|
||||
ansible.builtin.shell:
|
||||
cmd: rm -f "private{{ item }}.key" "cert{{ item }}.pem" "cert{{ item }}.der" "cert{{ item }}.b64"
|
||||
with_items: [1, 2, 3]
|
||||
become: no
|
||||
|
||||
@@ -4,10 +4,10 @@
|
||||
|
||||
tasks:
|
||||
- name: Check if users.json exists
|
||||
stat:
|
||||
ansible.builtin.stat:
|
||||
path: users.json
|
||||
register: register_stat_users
|
||||
|
||||
- name: Create users.json
|
||||
command: /bin/bash users.sh 500
|
||||
ansible.builtin.command: /bin/bash users.sh 500
|
||||
when: not register_stat_users.stat.exists
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
tasks:
|
||||
- name: Include FreeIPA facts.
|
||||
include_tasks: ../env_freeipa_facts.yml
|
||||
ansible.builtin.include_tasks: ../env_freeipa_facts.yml
|
||||
|
||||
# Test will only be executed if host is not a server.
|
||||
- name: Execute with server context in the client.
|
||||
@@ -27,13 +27,13 @@
|
||||
# in upstream CI.
|
||||
|
||||
- name: Test user using client context, in client host.
|
||||
import_playbook: test_user.yml
|
||||
ansible.builtin.import_playbook: test_user.yml
|
||||
when: groups['ipaclients']
|
||||
vars:
|
||||
ipa_test_host: ipaclients
|
||||
|
||||
- name: Test user using client context, in server host.
|
||||
import_playbook: test_user.yml
|
||||
ansible.builtin.import_playbook: test_user.yml
|
||||
when: groups['ipaclients'] is not defined or not groups['ipaclients']
|
||||
vars:
|
||||
ipa_context: client
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
ipauser.failed
|
||||
|
||||
- name: Print generated random password
|
||||
debug:
|
||||
ansible.builtin.debug:
|
||||
var: ipauser.user.randompassword
|
||||
|
||||
- name: User user1 absent
|
||||
@@ -56,11 +56,11 @@
|
||||
ipauser.failed
|
||||
|
||||
- name: Print generated random password for user1
|
||||
debug:
|
||||
ansible.builtin.debug:
|
||||
var: ipauser.user.user1.randompassword
|
||||
|
||||
- name: Print generated random password for user2
|
||||
debug:
|
||||
ansible.builtin.debug:
|
||||
var: ipauser.user.user2.randompassword
|
||||
|
||||
- name: Users user1 and user2 absent
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
---
|
||||
- name: Include create_users_json.yml
|
||||
import_playbook: create_users_json.yml
|
||||
ansible.builtin.import_playbook: create_users_json.yml
|
||||
|
||||
- name: Test users absent
|
||||
hosts: ipaserver
|
||||
@@ -9,11 +9,11 @@
|
||||
|
||||
tasks:
|
||||
- name: Include users.json
|
||||
include_vars:
|
||||
ansible.builtin.include_vars:
|
||||
file: users.json # noqa 505
|
||||
|
||||
- name: Create dict with user names
|
||||
set_fact:
|
||||
ansible.builtin.set_fact:
|
||||
user_names: "{{ user_names | default([]) + [{ 'name': item.name }] }}"
|
||||
loop: "{{ users }}"
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
tasks:
|
||||
- name: Generate self-signed certificates.
|
||||
shell:
|
||||
ansible.builtin.shell:
|
||||
cmd: |
|
||||
openssl req -x509 -newkey rsa:2048 -days 365 -nodes -keyout "private{{ item }}.key" -out "cert{{ item }}.pem" -subj '/CN=test'
|
||||
openssl x509 -outform der -in "cert{{ item }}.pem" -out "cert{{ item }}.der"
|
||||
@@ -55,7 +55,7 @@
|
||||
failed_when: not result.changed or result.failed
|
||||
|
||||
- name: Remove certificate files. # noqa: deprecated-command-syntax
|
||||
shell:
|
||||
ansible.builtin.shell:
|
||||
cmd: rm -f "private{{ item }}.key" "cert{{ item }}.pem" "cert{{ item }}.der" "cert{{ item }}.b64"
|
||||
with_items: [1, 2]
|
||||
become: no
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
---
|
||||
- name: Include create_users_json.yml
|
||||
import_playbook: create_users_json.yml
|
||||
ansible.builtin.import_playbook: create_users_json.yml
|
||||
|
||||
- name: Test users present
|
||||
hosts: ipaserver
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
tasks:
|
||||
- name: Include users.json
|
||||
include_vars:
|
||||
ansible.builtin.include_vars:
|
||||
file: users.json # noqa 505
|
||||
|
||||
- name: Users present len:{{ users | length }}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
---
|
||||
- name: Include create_users_json.yml
|
||||
import_playbook: create_users_json.yml
|
||||
ansible.builtin.import_playbook: create_users_json.yml
|
||||
|
||||
- name: Test users present slice
|
||||
hosts: ipaserver
|
||||
@@ -11,10 +11,10 @@
|
||||
slice_size: 500
|
||||
tasks:
|
||||
- name: Include users.json
|
||||
include_vars:
|
||||
ansible.builtin.include_vars:
|
||||
file: users.json # noqa 505
|
||||
- name: Size of users slice.
|
||||
debug:
|
||||
ansible.builtin.debug:
|
||||
msg: "{{ users | length }}"
|
||||
- name: Users present
|
||||
ipauser:
|
||||
|
||||
Reference in New Issue
Block a user