Serverspec cronの設定を検証するサンプル
環境
RHEL8.6
Serverspec
構文
describe cron do it { should have_entry(xxxx).with_user('ユーザー名')endエント ...
RHEL8 Serverspecを利用する方法
環境
Serverspec
RHEL8.6
操作方法
1.Serverspecのインストールを行います
$ gem install serverspec
2.Serverspec ...
Serverspec host_inventoryの使い方のサンプル
環境
Severspec
RHEL8.6
操作方法
1.host_inventory
ホスト名を取得します。
2.host_inventory
デバイスパスで割り当てられ ...
Serverspec Locale、Timezoneのテストのサンプル
環境
Serverspec
RedHat 8.6
書式
describe locale(‘コマンド’) do
its(<対象>) { should <条件> <値> ...
Serverspec timestampの確認サンプル
環境
Serverspec
RedHat 8.6
書式
it { should <条件> }
its(<対象>) { should <条件> <値> }
「テスト条件」は対象とするリ ...
Serverspec swapファイルの確認サンプル
環境
Serverspec
RedHat 8.6
書式
it { should <条件> }
its(<対象>) { should <条件> <値> }
「テスト条件」は対象とするリ ...
Serverspec テストスクリプトの文法のサンプル
環境
Serverspec
RedHat 8.6
操作例
ファイル名 httpd_spec.rb
1.spec/spec_helper.rbを実行する
require ‘ ...
RHEL8.6 Serverspecのインストール方法
環境
Serverspec
RedHat 8.6
操作方法
1.Serverspecのインストール
Rubyおよびgemコマンドが利用できる環境であれば、以下のようにしてインストールする ...
RHEL8.6 Ansible templateモジュールの使い方のサンプル
Ansible templateモジュールの使い方のサンプル
環境
Ansible
RHEL8.6
構文
– template: src=”ローカル側のテンプレートのファイルパス”
dest=”リモート側 ...
Ansible fileモジュールで指定日以上のファイルを削除するサンプル
環境
Ansible
RHEL8.6
構文
1.shellモジュール
– shell: find/パスs/log.???????? -maxdepth 0 -ctime +指定日 ...
Ansible fileモジュールでファイルの属性を変更するサンプル
環境
Ansible
RHEL8
構文
- file: path=作成したいパス owner=ユーザー名 group=グループ名 mode=0644ファイルパス、ユーザー名、グループ名を指定しま ...
Ansible shellモジュールで存在ファイルやディレクトリをスキップするサンプル
環境
Ansible
構文
- shell: シェル args: chdir: 実行ディレクトリ(省略可) creates: ファイルやフォルダ使用例
ディレクトリ「/usr/local/dat ...
Ansible cronモジュールでcronを設定する方法
環境
Ansible
RHEL8.6
構文
cron: name: 時刻チェック minute: 分 hour: 時 job: " xxx" state: presentAnsibleでcron ...
Playbook パッケージのアンインストールの書き方のサンプル
環境
Ansible 2.9
RHEL8
Python 3.8
構文
yum : name:パッケージ名 state:absent使用例
- hosts: all become: ...Playbook 複数のパッケージをインストールする方法
環境
Ansible 2.9
RHEL8
Python 3.8
構文
yum: name: - package1 - package2使用例
パッケージsquid、perl、ht ...
Playbook state:latestですべてのパッケージをアップデートする
環境
Ansible 2.9
RHEL8
Python 3.8
構文
yum:name: '*'state: latestname: ‘*’ かつ state: ...
Playbook パッケージのインストールの書き方のサンプル
環境
Ansible 2.9
RHEL8
Python 3.8
構文
yum:
name:パッケージ名
state:present
操作例
パッケージht ...