This commit is contained in:
50
ansible/roles/sysprep/tasks/photon.yml
Normal file
50
ansible/roles/sysprep/tasks/photon.yml
Normal file
@ -0,0 +1,50 @@
|
||||
# Copyright 2019 The Kubernetes Authors.
|
||||
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
---
|
||||
- name: Define file modes
|
||||
set_fact:
|
||||
last_log_mode: "0644"
|
||||
machine_id_mode: "0444"
|
||||
|
||||
- name: set hostname
|
||||
command: hostnamectl set-hostname localhost.local
|
||||
|
||||
- name: Remove the kickstart log
|
||||
file:
|
||||
state: absent
|
||||
path: /root/anaconda-ks.cfg
|
||||
|
||||
- name: Get installed packages
|
||||
shell: tdnf list installed | cut -d ' ' -f 1
|
||||
register: packages
|
||||
|
||||
- name: create a package list
|
||||
set_fact:
|
||||
package_list: "{{ packages.stdout_lines | join(' ') }}"
|
||||
|
||||
- name: exclude packages from upgrade
|
||||
lineinfile:
|
||||
path: /etc/tdnf/tdnf.conf
|
||||
regexp: '^excludepkgs='
|
||||
line: excludepkgs={{ package_list }}
|
||||
|
||||
- import_tasks: rpm_repos.yml
|
||||
|
||||
- name: Remove tdnf package caches
|
||||
command: /usr/bin/tdnf -y clean all
|
||||
|
||||
- name: Lock root account
|
||||
user:
|
||||
name: root
|
||||
password_lock: yes
|
Reference in New Issue
Block a user